mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-24 23:54:56 +08:00
[Dynamo] Handle extracted unbound tensor methods (#137227)
fixes2 Pull Request resolved: https://github.com/pytorch/pytorch/pull/137227 Approved by: https://github.com/williamwen42, https://github.com/anijain2305 ghstack dependencies: #137114, #137115, #137116, #137117, #137120
This commit is contained in:
committed by
PyTorch MergeBot
parent
b3f30c9bc3
commit
0a304d9048
@ -938,6 +938,16 @@ class FunctionTests(torch._dynamo.test_case.TestCase):
|
||||
else:
|
||||
return x - 1
|
||||
|
||||
@make_test
|
||||
def test_tensor_size(x):
|
||||
fn = torch.Tensor.size
|
||||
return fn(x + 1)
|
||||
|
||||
@make_test
|
||||
def test_tensor_dim(x):
|
||||
fn = torch.Tensor.dim
|
||||
return fn(x + 1)
|
||||
|
||||
@make_test
|
||||
def test_tensor_is_inference(x):
|
||||
if x.is_inference():
|
||||
|
||||
Reference in New Issue
Block a user