DataModule.transform_y

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

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

Parameters:
  • y (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.