mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
better error message (#147532)
Differential Revision: [D69939736](https://our.internmc.facebook.com/intern/diff/D69939736) Pull Request resolved: https://github.com/pytorch/pytorch/pull/147532 Approved by: https://github.com/avikchaudhuri, https://github.com/zou3519
This commit is contained in:
parent
a8ce4d1846
commit
6a6de0e09d
|
|
@ -94,7 +94,13 @@ def fakify(
|
|||
return t
|
||||
|
||||
if not isinstance(t, torch.Tensor):
|
||||
raise ValueError(f"Unsupported input type {type(t)}")
|
||||
raise ValueError(
|
||||
f"Unsupported input type {type(t)}. "
|
||||
"Export only supports pytree containers of basic types (Tensor, int, float, ...) as input. "
|
||||
"To register a custom dataclass, use torch.export.register_dataclass. "
|
||||
"To register a custom container type, use torch.utils._pytree.register_pytree_node. "
|
||||
"To register a constant input, use torch.utils._pytree.register_constant"
|
||||
)
|
||||
n_dims = len(t.shape)
|
||||
dynamic_sizes = []
|
||||
constraint_sizes = [None] * n_dims
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user