Fix the error of type casting in dynamo example (#1860)

pull/1919/merge snapshot-20230308.771
Kan Chen 2023-03-08 00:50:35 +08:00 committed by GitHub
parent 13533307ca
commit 86b792520b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -91,4 +91,4 @@ resnet18 = models.resnet18(pretrained=True)
resnet18.train(False)
dynamo_callable = dynamo.optimize(refbackend_torchdynamo_backend)(resnet18)
predictions(resnet18.forward, lambda x: dynamo_callable(torch.from_numpy(x)).numpy(), img, labels)
predictions(resnet18.forward, lambda x: dynamo_callable(torch.from_numpy(x)).detach().numpy(), img, labels)