I have a variable called samples and when I do type(samples) it gives me <class 'util.misc.NestedTensor'>.
when I print it, it looks like a normal tensor, but when I do samples.shape it gives an error that *** AttributeError: 'NestedTensor' object has no attribute 'shape'
I guess my question is what is NestedTensor n pytorch and how I can get the shape of it?
NestedTensor is a package to work with tensors of different sizes and lengths. It should be released soon, so I guess you might be using the nightly binary?
Anyway, I’m not sure if .shape should return this error or some struct containing different lengths.
CC @cpuhrsch who is the main author of this package.
Ah OK, in that case it seems to be a custom implementation from here, which just doesn’t support the shape attribute, but I also haven’t looked at this repository deeply.