|
22 | 22 | from onnxscript.onnx_types import TensorType |
23 | 23 |
|
24 | 24 |
|
25 | | -def aten_abs(self: TensorType) -> TensorType: |
| 25 | +def aten_abs(self): |
26 | 26 | # abs(Tensor self) -> Tensor |
27 | 27 |
|
28 | | - raise NotImplementedError() |
29 | | - |
30 | | - |
31 | | -def aten_absolute(self: TensorType) -> TensorType: |
32 | | - # absolute(Tensor self) -> Tensor |
33 | | - |
34 | | - raise NotImplementedError() |
| 28 | + return op.Abs(self) |
35 | 29 |
|
36 | 30 |
|
37 | | -def aten_acos(self: TensorType) -> TensorType: |
| 31 | +def aten_acos(self): |
38 | 32 | # acos(Tensor self) -> Tensor |
39 | 33 |
|
40 | | - raise NotImplementedError() |
| 34 | + return op.Acos(self) |
41 | 35 |
|
42 | 36 |
|
43 | | -def aten_acosh(self: TensorType) -> TensorType: |
| 37 | +def aten_acosh(self): |
44 | 38 | # acosh(Tensor self) -> Tensor |
45 | 39 |
|
46 | | - raise NotImplementedError() |
| 40 | + return op.Acosh(self) |
47 | 41 |
|
48 | 42 |
|
49 | 43 | def aten_adaptive_avg_pool1d(self: TensorType, output_size: Sequence[int]) -> TensorType: |
@@ -91,12 +85,13 @@ def aten_addcmul( |
91 | 85 | raise NotImplementedError() |
92 | 86 |
|
93 | 87 |
|
94 | | -def aten_addmm( |
95 | | - self: TensorType, mat1: TensorType, mat2: TensorType, beta: float = 1, alpha: float = 1 |
96 | | -) -> TensorType: |
| 88 | +def aten_addmm(self, mat1, mat2, beta: float = 1, alpha: float = 1): |
97 | 89 | # addmm(Tensor self, Tensor mat1, Tensor mat2, *, Scalar beta=1, Scalar alpha=1) -> Tensor |
98 | 90 |
|
99 | | - raise NotImplementedError() |
| 91 | + mat1_mat2 = op.MatMul(mat1, mat2) |
| 92 | + scaled_mat1_mat2 = op.Mul(mat1_mat2, alpha) # type: ignore[arg-type] |
| 93 | + scaled_self = op.Mul(self, beta) # type: ignore[arg-type] |
| 94 | + return op.Add(scaled_self, scaled_mat1_mat2) # type: ignore[arg-type] |
100 | 95 |
|
101 | 96 |
|
102 | 97 | def aten_addmv( |
@@ -611,10 +606,10 @@ def aten_block_diag(tensors: Sequence[TensorType]) -> TensorType: |
611 | 606 | raise NotImplementedError() |
612 | 607 |
|
613 | 608 |
|
614 | | -def aten_bmm(self: TensorType, mat2: TensorType) -> TensorType: |
| 609 | +def aten_bmm(self, mat2): |
615 | 610 | # bmm(Tensor self, Tensor mat2) -> Tensor |
616 | 611 |
|
617 | | - raise NotImplementedError() |
| 612 | + return op.MatMul(self, mat2) |
618 | 613 |
|
619 | 614 |
|
620 | 615 | def aten_broadcast_tensors(tensors: Sequence[TensorType]) -> TensorType: |
|
0 commit comments