docstr: Returns x as a Tensor.  Fails if x contains ragged rows.
docstr_tok: ["Returns","x","as","a","Tensor",".","Fails","if","x","contains","ragged","rows","."]
code: def ensure_non_ragged(self, x):
      """Returns x as a Tensor.  Fails if x contains ragged rows."""
      if not isinstance(x, ragged_tensor.RaggedTensor):
          return x
      x_uniform = x.to_tensor()
      self.assertAllEqual(array_ops.size(x), array_ops.size(x_uniform))
      return x_uniform
  
imports: from absl.testing import parameterized
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  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 import ragged_concat_ops
  from tensorflow.python.ops.ragged import ragged_factory_ops
  from tensorflow.python.ops.ragged import ragged_math_ops
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 2 for calling the RaggedMatmulOpTest obj's underlying member method code with example usage: obj.ensure_non_ragged(x) and returns: x_uniform, x