import torch


def min_tensor_value(tensor):
  """Returns the minimum value in a tensor, as a float (primitive)."""
  #return float(tensor.min(tensor.Tensor.type(torch.float32))) # old
  if type(tensor) is int: return tensor
  return float(torch.min(tensor))