def METHOD_NAME(tensors):
  """Gets classes for a structure of tensors.
  Args:
    tensors: the tensor structure to get classes for.
  Returns:
    a structure matching the nested structure of `tensors`, containing
    `tf.SparseTensor` at positions where `tensors` contains a sparse tensor and
    `tf.Tensor` otherwise
  """
  return nest.pack_sequence_as(tensors, [
      sparse_tensor.SparseTensor
      if isinstance(tensor, sparse_tensor.SparseTensor) else ops.Tensor
      for tensor in nest.flatten(tensors)
  ])