class_docstr: Tests shape-related utility functions.
      
docstr: Tests :func:`texar.tf.utils.shapes.reduce_with_weights`
          
code: def test_reduce_with_weights(self):
      """Tests :func:`texar.tf.utils.shapes.reduce_with_weights`"""
      x = np.asarray([[10, 10, 2, 2], [20, 2, 2, 2]])
      x = tf.constant(x)
      w = np.asarray([[1, 1, 0, 0], [1, 0, 0, 0]])
  
      z = shapes.reduce_with_weights(x, weights=w)
  
      with self.test_session() as sess:
          z_ = sess.run(z)
          np.testing.assert_array_equal(z_, 20)
  
file_path: texar/tests/utils/shapes_test.py
imports: import numpy
  import tensorflow
  from texar.tf.utils import shapes
label_desc: Use image node_id 2 for calling the ShapesTest obj's underlying member method code with example usage: obj.test_reduce_with_weights() without return types