DataModule.transform_x

DataModule.transform_x(x: torch.Tensor | ndarray, out_type: str = 'numpy') torch.Tensor | ndarray[source]

Transform only the input data. Takes care of the case where x is a numpy array or a torch tensor.

Parameters:
  • x (Union[torch.Tensor, np.ndarray]) – A numpy array or a torch tensor to be transformed.

  • out_type (str, optional) – The type of the output. Can be “numpy”, “torch”, or “same”. The default is “numpy”.

Returns:

Union[torch.Tensor, np.ndarray] – The transformed data.