def _get_empirical_parameters():
  """Gets the number of parameters built into the current Tensorflow graph."""
  trainable_variables_list = tf.trainable_variables()

  empirical_num_params = 0
  for variable_tensor in trainable_variables_list:
    empirical_num_params += np.prod(variable_tensor.shape)

  return empirical_num_params
Gets the number of parameters built into the current Tensorflow graph.
tensor2tensor/models/neural_architecture_search/nas_layers_test.py