Image

class torchaug.ta_tensors.Image(data: Any, *, dtype: dtype | None = None, device: device | str | int | None = None, requires_grad: bool | None = None)[source]

torch.Tensor subclass for images.

Parameters:
  • data – Any data that can be turned into a tensor with torch.as_tensor().

  • dtype – Desired data type. If omitted, will be inferred from data.

  • device – Desired device. If omitted and data is a torch.Tensor, the device is taken from it. Otherwise, the image is constructed on the CPU.

  • requires_grad – Whether autograd should record operations. If omitted and data is a torch.Tensor, the value is taken from it. Otherwise, defaults to False.