class_docstr: Test cases for binary operators.
code: def testExpandDims(self):
      for dtype in self.numeric_types:
          self._testBinary(
              array_ops.expand_dims,
              dtype(7),
              np.int32(0),
              expected=np.array([7], dtype=dtype),
          )
          self._testBinary(
              array_ops.expand_dims,
              np.array([42], dtype=dtype),
              np.array([0], dtype=np.int64),
              expected=np.array([[42]], dtype=dtype),
          )
          self._testBinary(
              array_ops.expand_dims,
              np.array([], dtype=dtype),
              np.int32(0),
              expected=np.array([[]], dtype=dtype),
          )
          self._testBinary(
              array_ops.expand_dims,
              np.array([[[1, 2], [3, 4]]], dtype=dtype),
              np.int32(0),
              expected=np.array([[[[1, 2], [3, 4]]]], dtype=dtype),
          )
          self._testBinary(
              array_ops.expand_dims,
              np.array([[[1, 2], [3, 4]]], dtype=dtype),
              np.int32(1),
              expected=np.array([[[[1, 2], [3, 4]]]], dtype=dtype),
          )
          self._testBinary(
              array_ops.expand_dims,
              np.array([[[1, 2], [3, 4]]], dtype=dtype),
              np.int32(2),
              expected=np.array([[[[1, 2]], [[3, 4]]]], dtype=dtype),
          )
          self._testBinary(
              array_ops.expand_dims,
              np.array([[[1, 2], [3, 4]]], dtype=dtype),
              np.int32(3),
              expected=np.array(
                  [[[[1], [2]], [[3], [4]]]], dtype=dtype
              ),
          )
          self._testBinary(
              array_ops.expand_dims,
              np.array([[[1, 2], [3, 4]]], dtype=dtype),
              np.array([2], dtype=np.int64),
              expected=np.array([[[[1, 2]], [[3, 4]]]], 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 29 for calling the BinaryOpsTest obj's underlying member method code with example usage: obj.testExpandDims() without return types