docstr: Tests scalar v2 invocation when v1 step is set.
docstr_tok: ["Tests","scalar","v2","invocation","when","v1","step","is","set","."]
code: def test_scalar_summary_v2__v1_set_step(self):
      """Tests scalar v2 invocation when v1 step is set."""
      global_step = training_util.create_global_step()
      global_step.assign(1024)
      with test.mock.patch.object(
          summary_v2, "scalar", autospec=True
      ) as mock_scalar_v2:
          with summary_ops_v2.create_summary_file_writer(
              self.get_temp_dir()
          ).as_default():
              i = constant_op.constant(2.5)
              tensor = summary_lib.scalar("float", i)
      # Returns empty string.
      self.assertEqual(tensor.numpy(), b"")
      self.assertEqual(tensor.dtype, dtypes.string)
      mock_scalar_v2.assert_called_once_with(
          name="float", data=i, step=1024, description=test.mock.ANY
      )
  
imports: from tensorboard.summary import v2
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import summary_ops_v2
  from tensorflow.python.platform import test
  from tensorflow.python.summary import summary
  from tensorflow.python.training import training_util
label_desc: Use image node_id 6 for calling the SummaryV2Test obj's underlying member method code with example usage: obj.test_scalar_summary_v2__v1_set_step() without return types