code: def testAssignReturnValueIsTensorLike(
      self, distribution, synchronization, aggregation
  ):
      if isinstance(distribution.extended, tpu_strategy.TPUExtended):
          if context.executing_eagerly():
              self.skipTest("TPU doesn't support pure eager")
          else:
              self.skipTest("b/152076846")
  
      with distribution.scope():
          v = variables_lib.Variable(
              0.0,
              synchronization=synchronization,
              aggregation=aggregation,
          )
  
      def assert_is_tensor_like(v):
          # We can't use Python literals because they are treated as non-distributed
          # values is not allowed when aggregation is SUM. See
          # `cross_device_ops.reduce_non_distributed_value`.
          delta = array_ops.identity(1.0)
          self.assertIsInstance(v.assign(delta), core.Tensor)
          self.assertIsInstance(v.assign_sub(delta), core.Tensor)
          self.assertIsInstance(v.assign_add(delta), core.Tensor)
  
      # In cross replica context we return a PerReplica which is not Tensor like
      # all the time yet.
      if (
          synchronization
          == variables_lib.VariableSynchronization.ON_READ
          and aggregation != variables_lib.VariableAggregation.SUM
      ):
          assert_is_tensor_like(v)
  
      # In replica context.
      distribution.run(assert_is_tensor_like, args=(v,))
  
imports: import copy
  import os
  from absl.testing import parameterized
  from tensorflow.python.checkpoint import checkpoint
  from tensorflow.python.checkpoint import checkpoint_options
  from tensorflow.python.distribute import collective_all_reduce_strategy
  from tensorflow.python.distribute import combinations
  from tensorflow.python.distribute import distribute_lib
  from tensorflow.python.distribute import distribute_utils
  from tensorflow.python.distribute import packed_distributed_variable
  from tensorflow.python.distribute import parameter_server_strategy
  from tensorflow.python.distribute import ps_values
  from tensorflow.python.distribute import strategy_combinations
  from tensorflow.python.distribute import test_util
  from tensorflow.python.distribute import tpu_strategy
  from tensorflow.python.distribute import values
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.eager import test
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import indexed_slices
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import check_ops
  from tensorflow.python.ops import control_flow_assert
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.ops import variables
  from tensorflow.python.saved_model import save
  from tensorflow.python.saved_model import save_context
  from tensorflow.python.saved_model import save_options
  from tensorflow.python.types import core
label_desc: Use image node_id 7 for calling the DistributedVariableTest obj's underlying member method code with example usage: obj.testAssignReturnValueIsTensorLike(distribution, synchronization, aggregation) without return types