xla icon indicating copy to clipboard operation
xla copied to clipboard

subclass of torchTensor not handled correctly

Open yaoshiang opened this issue 6 months ago • 0 comments

there are five instances of code like this in the repo:

if type(v) == torch.Tensor:

This is incorrect because it does not handle subclasses of torch.Tensor. The correct approach is:

if isinstance(v, torch.Tensor):

yaoshiang avatar May 29 '25 23:05 yaoshiang