docstr: Test if custom name for the variable scope is propagated correctly.
docstr_tok: ["Test","if","custom","name","for","the","variable","scope","is","propagated","correctly","."]
code: def testVariableName(self):
      """Test if custom name for the variable scope is propagated correctly."""
      g = ops.Graph()
      with g.as_default():
          a = variables.Variable(2.2, name="var_a")
          b = variables.Variable(3.3, name="var_b")
          d = variables.Variable(4.4, name="var_b")
          with g.name_scope("scope1"):
              with bfloat16.bfloat16_scope("bf16"):
                  a = math_ops.cast(a, dtypes.bfloat16)
                  b = math_ops.cast(b, dtypes.bfloat16)
                  c = math_ops.add(a, b, name="addition")
              with bfloat16.bfloat16_scope():
                  d = math_ops.cast(d, dtypes.bfloat16)
                  math_ops.add(c, d, name="addition")
  
      g_ops = g.get_operations()
      ops_name = []
      for op in g_ops:
          ops_name.append(str(op.name))
  
      self.assertIn("scope1/bf16/addition", ops_name)
      self.assertIn("scope1/bf16/Cast", ops_name)
      self.assertIn("scope1/addition", ops_name)
      self.assertIn("scope1/Cast", ops_name)
  
file_path: tensorflow-upstream/tensorflow/python/tpu/bfloat16_test.py
imports: from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.platform import test
  from tensorflow.python.tpu import bfloat16
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variables
label_desc: Use image node_id 3 for calling the BFloat16ScopeTest obj's underlying member method code with example usage: obj.testVariableName() without return types