class_docstr: NASNet Cell class that is used as a 'layer' in image architectures.
class_docstr_tok: ["NASNet","Cell","class","that","is","used","as","a","'layer","'","in","image","architectures","."]
docstr: Matches dimension of prev_layer to the curr_layer.
docstr_tok: ["Matches","dimension","of","prev_layer","to","the","curr_layer","."]
code: def _reduce_prev_layer(self, prev_layer, curr_layer):
      """Matches dimension of prev_layer to the curr_layer."""
      # Set the prev layer to the current layer if it is none
      if prev_layer is None:
          return curr_layer
      curr_num_filters = self._filter_size
      prev_num_filters = get_channel_dim(prev_layer.shape)
      curr_filter_shape = int(curr_layer.shape[2])
      prev_filter_shape = int(prev_layer.shape[2])
      activation_fn = (
          tf.nn.relu6 if self._use_bounded_activation else tf.nn.relu
      )
      if curr_filter_shape != prev_filter_shape:
          prev_layer = activation_fn(prev_layer)
          prev_layer = factorized_reduction(
              prev_layer, curr_num_filters, stride=2
          )
      elif curr_num_filters != prev_num_filters:
          prev_layer = activation_fn(prev_layer)
          prev_layer = slim.conv2d(
              prev_layer, curr_num_filters, 1, scope="prev_1x1"
          )
          prev_layer = slim.batch_norm(prev_layer, scope="prev_bn")
      return prev_layer
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling the NasNetABaseCell obj's underlying member method code with example usage: obj._reduce_prev_layer(prev_layer, curr_layer) and returns: prev_layer, curr_layer