code: def testDocStringExamples(self):
      # The examples from RaggedTensor.from_tensor.__doc__.
      dt = constant_op.constant([[5, 7, 0], [0, 3, 0], [6, 0, 0]])
      self.assertAllEqual(
          RaggedTensor.from_tensor(dt),
          [[5, 7, 0], [0, 3, 0], [6, 0, 0]],
      )
  
      self.assertAllEqual(
          RaggedTensor.from_tensor(dt, lengths=[1, 0, 3]),
          [[5], [], [6, 0, 0]],
      )
  
      self.assertAllEqual(
          RaggedTensor.from_tensor(dt, padding=0), [[5, 7], [0, 3], [6]]
      )
  
      dt_3d = constant_op.constant(
          [
              [[5, 0], [7, 0], [0, 0]],
              [[0, 0], [3, 0], [0, 0]],
              [[6, 0], [0, 0], [0, 0]],
          ]
      )
      self.assertAllEqual(
          RaggedTensor.from_tensor(
              dt_3d, lengths=([2, 0, 3], [1, 1, 2, 0, 1])
          ),
          [[[5], [7]], [], [[6, 0], [], [0]]],
      )
  
file_path: tensorflow-upstream/tensorflow/python/ops/ragged/ragged_from_tensor_op_test.py
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops.ragged.ragged_tensor import RaggedTensor
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 1 for calling the RaggedTensorFromTensorOpTest obj's underlying member method code with example usage: obj.testDocStringExamples() without return types