class_docstr: Test reductions for sum and boolean all over a wide range of shapes.
class_docstr_tok: ["Test","reductions","for","sum","and","boolean","all","over","a","wide","range","of","shapes","."]
code: def testFloat32Bfloat16Mean(self):
      arrfp32 = np.random.normal(size=[4105, 4105]).astype(np.float32)
      arrbf16 = arrfp32.astype(dtypes.bfloat16.as_numpy_dtype)
      with self.session(graph=ops.Graph(), use_gpu=False) as sess:
          arrfp32_placeholder = array_ops.placeholder(
              dtype=np.float32, shape=(4105, 4105)
          )
          arrbf16_placeholder = array_ops.placeholder(
              dtype=dtypes.bfloat16.as_numpy_dtype, shape=(4105, 4105)
          )
          tf_full_mean_fp32 = self._tf_reduce_mean(
              arrfp32_placeholder, [0, 1], False
          )
          tf_full_mean_bf16 = self._tf_reduce_mean(
              arrbf16_placeholder, [0, 1], False
          )
          tf_full_mean_bf16_cast = math_ops.cast(
              tf_full_mean_bf16, dtypes.float32
          )
  
          tf_out_full_f, tf_out_full_b = sess.run(
              [tf_full_mean_fp32, tf_full_mean_bf16_cast],
              {
                  arrfp32_placeholder: arrfp32,
                  arrbf16_placeholder: arrbf16,
              },
          )
      self.assertAllClose(tf_out_full_f, tf_out_full_b)
  
file_path: tensorflow-upstream/tensorflow/python/kernel_tests/math_ops/reduction_ops_test_big.py
imports: import numpy
  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 math_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 5 for calling the BigReductionTest obj's underlying member method code with example usage: obj.testFloat32Bfloat16Mean() without return types