class_docstr: Test cases for binary operators.
docstr: Tests broadcasting behavior of an operator.
docstr_tok: ["Tests","broadcasting","behavior","of","an","operator","."]
code: def testBroadcasting(self):
      """Tests broadcasting behavior of an operator."""
  
      for dtype in self.numeric_types:
          self._testBinary(
              math_ops.add,
              np.array(3, dtype=dtype),
              np.array([10, 20], dtype=dtype),
              expected=np.array([13, 23], dtype=dtype),
          )
          self._testBinary(
              math_ops.add,
              np.array([10, 20], dtype=dtype),
              np.array(4, dtype=dtype),
              expected=np.array([14, 24], dtype=dtype),
          )
  
          # [1,3] x [4,1] => [4,3]
          self._testBinary(
              math_ops.add,
              np.array([[10, 20, 30]], dtype=dtype),
              np.array([[1], [2], [3], [4]], dtype=dtype),
              expected=np.array(
                  [
                      [11, 21, 31],
                      [12, 22, 32],
                      [13, 23, 33],
                      [14, 24, 34],
                  ],
                  dtype=dtype,
              ),
          )
  
          # [3] * [4,1] => [4,3]
          self._testBinary(
              math_ops.add,
              np.array([10, 20, 30], dtype=dtype),
              np.array([[1], [2], [3], [4]], dtype=dtype),
              expected=np.array(
                  [
                      [11, 21, 31],
                      [12, 22, 32],
                      [13, 23, 33],
                      [14, 24, 34],
                  ],
                  dtype=dtype,
              ),
          )
  
imports: import itertools
  import numpy
  from tensorflow.compiler.tests import xla_test
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import bitwise_ops
  from tensorflow.python.ops import gen_array_ops
  from tensorflow.python.ops import gen_math_ops
  from tensorflow.python.ops import gen_nn_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.platform import googletest
  from tensorflow.python.platform import test
label_desc: Use image node_id 22 for calling the BinaryOpsTest obj's underlying member method code with example usage: obj.testBroadcasting() without return types