def calculate_depthwise_channel_multiplier(input_depth, output_depth):
  """Calculates channel multiplier for depthwise convolution."""
  # Check to see if the output_depth >= input_depth
  # and output_depth % input_depth == 0. If this is the case then we
  # can satify the output_depth constraint, so the channel multiplier
  # will be set accordingly.
  if output_depth >= input_depth and output_depth % input_depth == 0:
    return output_depth // input_depth
  return 1
Calculates channel multiplier for depthwise convolution.
tensor2tensor/models/neural_architecture_search/nas_layers.py