We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a721594 commit fc55866Copy full SHA for fc55866
tensordict/tensorclass.py
@@ -1551,7 +1551,9 @@ def is_tensor_or_optional_tensor(type_hint):
1551
)
1552
# Handle parameterized generics (e.g., TensorDict[str, Tensor])
1553
if origin is not None and isinstance(origin, type):
1554
- return issubclass(origin, _TensorTypes) or _is_tensor_collection(origin)
+ return issubclass(origin, _TensorTypes) or _is_tensor_collection(
1555
+ origin
1556
+ )
1557
return False
1558
1559
for key, val in cls._type_hints.items():
0 commit comments