We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 56358cc commit 7d25118Copy full SHA for 7d25118
pytensor/link/pytorch/dispatch/basic.py
@@ -13,12 +13,12 @@
13
@singledispatch
14
def pytorch_typify(data, dtype=None, **kwargs):
15
r"""Convert instances of PyTensor `Type`\s to PyTorch types."""
16
- try:
+ if isinstance(data, NoneType):
17
+ raise NotImplementedError(f"pytorch_typify is not implemented for {type(data)}")
18
+ if isinstance(data, slice):
19
20
+ else:
21
return torch.as_tensor(data, dtype=dtype)
- except RuntimeError:
- raise NotImplementedError(
- f"pytorch_typify got type {type(data)}, it should be an array"
- )
22
23
24
@pytorch_typify.register(NoneType)
0 commit comments