code: def testNumpyToLiteralToNumpyRoundtrip(self):
      def _DoRoundtripTest(ndarray_in):
          literal = xla_literal.ConvertNumpyArrayToLiteral(ndarray_in)
          ndarray_out = xla_literal.ConvertLiteralToNumpyArray(literal)
          np.testing.assert_allclose(ndarray_in, ndarray_out)
  
      _DoRoundtripTest(NumpyArrayBool([False, True, True, False]))
  
      for array, _, _ in itertools.chain(float_arrays, int_arrays):
          ## Scalars
          _DoRoundtripTest(array(42))
          _DoRoundtripTest(array(42, order="F"))
  
          ## 1D
          _DoRoundtripTest(array([42, 52]))
          _DoRoundtripTest(array([42, 52], order="F"))
  
          ## 2D
          _DoRoundtripTest(array([[1, 2, 3], [10, 20, 30]]))
          _DoRoundtripTest(array([[1, 2, 3], [10, 20, 30]], order="F"))
  
          ## 3D
          _DoRoundtripTest(
              array([[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]])
          )
          _DoRoundtripTest(
              array(
                  [[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]],
                  order="F",
              )
          )
  
imports: import collections
  import itertools
  import operator
  from absl.testing import absltest
  import numpy
  from local_xla.xla import xla_data_pb2
  from xla.python_api import xla_literal
label_desc: Use image node_id 12 for calling the XlaLiteralTest obj's underlying member method code with example usage: obj.testNumpyToLiteralToNumpyRoundtrip() without return types