code: def testNullaryLikeOpWithoutLayoutEager(
      self, is_graph, size, nullary_op
  ):
      layout_x = Layout.batch_sharded(
          self.mesh, batch_dim=_MESH_DIM_X, rank=1
      )
      layout_replicated = Layout.replicated(self.mesh, rank=1)
  
      tensor = array_ops.zeros([size], layout=None)
      tensor_like = nullary_op(tensor, layout=None)
      dtensor = array_ops.zeros([size], layout=layout_x)
      self.assertDTensorEqual(tensor, layout_x, dtensor)
  
      def fn(layout):
          return nullary_op(dtensor, layout=layout)
  
      if is_graph:
          fn = polymorphic_function.function(fn)
  
      with api.default_mesh(self.mesh):
          dtensor_like = fn(None)
  
      self.assertDTensorEqual(
          tensor_like, layout_replicated, dtensor_like
      )
  
file_path: tensorflow/tensorflow/dtensor/python/tests/array_ops_test.py
imports: import numpy
  from tensorflow.dtensor.python import api
  from tensorflow.dtensor.python import layout
  from tensorflow.dtensor.python.tests import test_util
  from tensorflow.python.eager.polymorphic_function import polymorphic_function
  from tensorflow.python.framework import combinations
  from tensorflow.python.ops import array_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 5 for calling the ArrayOpsTest obj's underlying member method code with example usage: obj.testNullaryLikeOpWithoutLayoutEager(is_graph, size, nullary_op) and returns: nullary_op