code: def test_preserves_static_num_steps(self):
      x = tf.Variable([5.0, 3.0])
      num_steps = 23
  
      # Check that we preserve static shapes with static `num_steps`.
      losses = minimize(
          loss_fn=lambda: (x - 2.0) ** 2,
          num_steps=num_steps,
          optimizer=_get_adam_optimizer(0.1),
      )
      self.assertAllEqual(losses.shape, [num_steps, 2])
  
imports: import collections
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python import optimizer
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.internal import tf_keras
  from tensorflow_probability.python.math.minimize import minimize
  from tensorflow_probability.python.math.minimize import minimize_stateless
label_desc: Use image node_id 5 for calling the MinimizeTests obj's underlying member method code with example usage: obj.test_preserves_static_num_steps() without return types