docstr: Can build op with dynamic shapes in graph mode.
docstr_tok: ["Can","build","op","with","dynamic","shapes","in","graph","mode","."]
code: def test_dynamic_shapes(self):
      """Can build op with dynamic shapes in graph mode."""
      if tf.executing_eagerly():
          return
      minimum = np.array([1.0, 1.0])
      scales = np.array([2.0, 3.0])
  
      @tff.math.make_val_and_grad_fn
      def quadratic(x):
          return tf.reduce_sum(input_tensor=scales * (x - minimum) ** 2)
  
      # Test with a vector of unknown dimension.
      start = tf.compat.v1.placeholder(tf.float32, shape=[None])
      op = tff.math.optimizer.conjugate_gradient_minimize(
          quadratic, initial_position=start, tolerance=1e-8
      )
      self.assertFalse(op.position.shape.is_fully_defined())
  
      with self.cached_session() as session:
          results = session.run(op, feed_dict={start: [0.6, 0.8]})
      self.assertTrue(results.converged)
      self.assertLessEqual(_norm(results.objective_gradient), 1e-8)
      self.assertArrayNear(results.position, minimum, 1e-5)
  
imports: import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 18 for calling the ConjugateGradientTest obj's underlying member method code with example usage: obj.test_dynamic_shapes() and returns: tf