def _create_nonpadding_list():
  """Creates the `nonpadding_list` for applying the encoder layers."""
  nonpadding_list = []
  for i in range(_BATCH_SIZE):
    nonpadding_list.append([1.0] * min(i + 2, _TOTAL_SEQUENCE_LENGTH) +
                           [0.0] * max((_TOTAL_SEQUENCE_LENGTH - i - 2), 0))
  return nonpadding_list
Creates the `nonpadding_list` for applying the encoder layers.
tensor2tensor/models/neural_architecture_search/nas_layers_test.py