mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[dynamo] Trace torch.typename (#144163)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/144163 Approved by: https://github.com/yanboliang, https://github.com/williamwen42, https://github.com/jansel ghstack dependencies: #144129, #144130, #144141, #144158
This commit is contained in:
committed by
PyTorch MergeBot
parent
3292220c43
commit
087c625261
@ -15,6 +15,7 @@ import inspect
|
||||
import itertools
|
||||
import os
|
||||
import random
|
||||
import typing
|
||||
import unittest
|
||||
import warnings
|
||||
import weakref
|
||||
@ -6497,6 +6498,13 @@ def forward(self, s0 : torch.SymInt, s1 : torch.SymInt, L_x_ : torch.Tensor):
|
||||
with mock.patch("torch._dynamo.eval_frame._maybe_set_eval_frame", bad):
|
||||
fn(torch.ones(3))
|
||||
|
||||
def test_torchname(self):
|
||||
def fn(obj):
|
||||
return torch.typename(obj)
|
||||
|
||||
opt_fn = torch.compile(fn, backend="eager")
|
||||
self.assertEqual(fn(typing.Any), opt_fn(typing.Any))
|
||||
|
||||
|
||||
instantiate_parametrized_tests(ReproTests)
|
||||
|
||||
|
@ -2853,7 +2853,6 @@ torch_non_c_binding_in_graph_functions = dict.fromkeys(
|
||||
"torch.sym_min",
|
||||
"torch.sym_not",
|
||||
"torch.tensordot",
|
||||
"torch.typename",
|
||||
"torch.unique_consecutive",
|
||||
"torch.use_deterministic_algorithms",
|
||||
],
|
||||
|
Reference in New Issue
Block a user