Skip to content

Commit 8015f43

Browse files
committed
fix
1 parent a656759 commit 8015f43

8 files changed

Lines changed: 417 additions & 235 deletions

File tree

paconvert/global_var.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ class GlobalManager:
8080
NO_NEED_CONVERT_LIST = [
8181
# Manfredss
8282
"torch.asin",
83+
"torch.Tensor.gcd",
84+
"torch.Tensor.gcd_",
85+
"torch.Tensor.lcm",
86+
"torch.Tensor.lcm_",
8387

8488
# zhimin
8589
"torch.Tensor.bfloat16",

tests/test_Tensor_t.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,31 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
#
1415

1516
import textwrap
1617

1718
from apibase import APIBase
1819

19-
obj = APIBase("torch.Tensor.t")
20+
obj = APIBase("torch.Tensor.T")
2021

2122

2223
def test_case_1():
2324
pytorch_code = textwrap.dedent(
2425
"""
2526
import torch
26-
a = torch.Tensor([[1.,2.], [3.,4.]])
27-
result = a.t()
27+
x = torch.arange(16).reshape(4, 4)
28+
result = x.T
29+
"""
30+
)
31+
obj.run(pytorch_code, ["result"])
32+
33+
34+
def test_case_2():
35+
pytorch_code = textwrap.dedent(
36+
"""
37+
import torch
38+
result = torch.arange(16).reshape(4, 4).T
2839
"""
2940
)
3041
obj.run(pytorch_code, ["result"])

0 commit comments

Comments
 (0)