code: def _get_tensor(self, is_finite):
      tensor = cond.cond(is_finite, lambda: 1.0, lambda: float("NaN"))
  
      if not distribute_lib.has_strategy():
          return tensor
  
      def get():
          rep_id = (
              distribute_lib.get_replica_context().replica_id_in_sync_group
          )
          return cond.cond(
              math_ops.equal(rep_id, 0), lambda: tensor, lambda: 1.0
          )
  
      distribution = distribute_lib.get_strategy()
      return distribution.extended.call_for_each_replica(get)
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.distribute import distribute_lib
  from tensorflow.python.distribute import mirrored_strategy
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import check_ops
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
  from tensorflow.python.training.experimental import loss_scale
label_desc: Use image node_id 1 for calling the DynamicLossScaleTest obj's underlying member method code with example usage: obj._get_tensor(is_finite) and returns: distribution, tensor, cond