code: def from_tensor(
      tensor,
      lengths=None,
      padding=None,
      ragged_rank=1,
      row_splits_dtype=dtypes.int64,
      name=None,
  ):
      if ragged_tensor.is_ragged(tensor):
          return tensor
      else:
          return ragged_tensor.RaggedTensor.from_tensor(
              tensor,
              lengths=lengths,
              padding=padding,
              ragged_rank=ragged_rank,
              row_splits_dtype=row_splits_dtype,
              name=name,
          )
  
file_path: tensorflow-upstream/tensorflow/python/ops/ragged/ragged_conversion_ops.py
imports: from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import indexed_slices
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_ragged_conversion_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops.ragged import ragged_tensor
label_desc: Use image node_id 1 for calling a global function with example usage: from_tensor(tensor, lengths, padding, ragged_rank, row_splits_dtype, name) and returns: tensor, ragged_tensor