code: def test_calculate_branching_model_parameters_transformer(
      self, get_config, expected_hidden_depths
  ):
      tf.reset_default_graph()
  
      (
          num_cells,
          left_inputs,
          left_layers,
          left_output_dims,
          right_inputs,
          right_layers,
          right_output_dims,
          combiner_functions,
          final_combiner_function,
          dummy_activations,
          dummy_norms,
          layer_registry,
          is_decoder,
      ) = get_config()
  
      # Get predicted number of parameters.
      (
          predicted_num_params,
          output_size,
          hidden_depths,
          _,
      ) = translation_nas_net.calculate_branching_model_parameters(
          encoding_depth=_EMBEDDING_DEPTH,
          left_inputs=left_inputs,
          left_layers=left_layers,
          left_output_dims=left_output_dims,
          right_inputs=right_inputs,
          right_layers=right_layers,
          right_output_dims=right_output_dims,
          combiner_functions=combiner_functions,
          final_combiner_function=final_combiner_function,
          layer_registry=layer_registry,
          num_cells=num_cells,
          encoder_depth=_EMBEDDING_DEPTH,
      )
  
      # Create model graph.
      input_tensor = tf.zeros([32, _INPUT_LENGTH, _EMBEDDING_DEPTH])
      hparams = transformer.transformer_small()
  
      if is_decoder:
          nonpadding = None
          mask_future = True
          decoder_self_attention_bias = (
              common_attention.attention_bias_lower_triangle(
                  _INPUT_LENGTH
              )
          )
          encoder_cell_outputs = [input_tensor] * 6
      else:
          nonpadding = tf.ones([32, _INPUT_LENGTH])
          mask_future = False
          decoder_self_attention_bias = None
          encoder_cell_outputs = None
  
      translation_nas_net.apply_nas_layers(
          input_tensor=input_tensor,
          left_inputs=left_inputs,
          left_layers=left_layers,
          left_activations=dummy_activations,
          left_output_dims=left_output_dims,
          left_norms=dummy_norms,
          right_inputs=right_inputs,
          right_layers=right_layers,
          right_activations=dummy_activations,
          right_output_dims=right_output_dims,
          right_norms=dummy_norms,
          combiner_functions=combiner_functions,
          final_combiner_function=final_combiner_function,
          num_cells=num_cells,
          nonpadding=nonpadding,
          layer_registry=layer_registry,
          mask_future=mask_future,
          hparams=hparams,
          var_scope="test",
          encoder_decoder_attention_bias=None,
          encoder_cell_outputs=encoder_cell_outputs,
          decoder_self_attention_bias=decoder_self_attention_bias,
          final_layer_norm=False,
      )
  
      # Count graph variables.
      trainable_variables_list = tf.trainable_variables()
      empirical_num_params = 0
      for variable_tensor in trainable_variables_list:
          empirical_num_params += _list_product(
              variable_tensor.shape.as_list()
          )
  
      # Compare.
      self.assertEqual(empirical_num_params, predicted_num_params)
      self.assertEqual(output_size, _EMBEDDING_DEPTH)
      self.assertEqual(hidden_depths, expected_hidden_depths)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  from tensor2tensor.data_generators import problem_hparams
  from tensor2tensor.layers import common_attention
  from tensor2tensor.models import transformer
  from tensor2tensor.models.neural_architecture_search import nas_layers
  from tensor2tensor.models.neural_architecture_search import nas_model
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 6 for calling the NasSeq2SeqTest obj's underlying member method code with example usage: obj.test_calculate_branching_model_parameters_transformer(get_config, expected_hidden_depths) without return types