Graph break on tostring for numpy remapping (#131007)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/131007
Approved by: https://github.com/williamwen42
This commit is contained in:
Michael Lazos
2024-07-17 19:16:14 -07:00
committed by PyTorch MergeBot
parent 8bf0be7c78
commit 22388ffe03

View File

@ -1171,8 +1171,8 @@ class NumpyNdarrayVariable(TensorVariable):
if name in ["__len__", "size", "tolist"]:
# delegate back to TensorVariable
return super().call_method(tx, name, args, kwargs)
if name == "tobytes":
unimplemented("tobytes is not modelled in torch._numpy")
if name in ("tostring", "tobytes"):
unimplemented(f"{name} is not modelled in torch._numpy")
proxy = tx.output.create_proxy(
"call_function",
numpy_method_wrapper(name),