code: def _to_torch(Z, dtype=None):
          
          if isinstance(Z, list):
              return [Classifier._to_torch(z, dtype=dtype) for z in Z]
          else:
              return Classifier._to_torch(Z)
docs: Converts a None, list, np.ndarray, or torch.Tensor to torch.Tensor