Rate this Page

torch.Tensor.element_size#

Tensor.element_size()int#

Returns the size in bytes of an individual element.

Example:

>>>torch.tensor([]).element_size()4>>>torch.tensor([],dtype=torch.uint8).element_size()1