patrick-kidger / torchtyping

Type annotations and dynamic checking for a tensor's shape, dtype, names, etc.
Apache License 2.0
1.39k stars 33 forks source link

Fix metaclass conflict for torch 1.9 #22

Closed gkorepanov closed 3 years ago

gkorepanov commented 3 years ago

In torch 1.9 a custom metaclass was added to torch.Tensor class, causing metaclass conflict while subclassing from torch.Tensor and TensorTypeMixin. This small fix seems to resolve the issue.

patrick-kidger commented 3 years ago

LGTM. Thanks for the fix!