def flatten_nested_lists(activation_maps):
  """Flattens a nested list of depth 3 in a row major order.

  Args:
    activation_maps: list of list of list of z3.ExprRef with dimensions
        (channels, activation_map_size, activation_map_size), activation_maps.

  Returns:
    list of z3.ExprRef.
  """
  flattened_activation_maps = []
  for activation_map in activation_maps:
    for activation_map_row in activation_map:
      flattened_activation_maps.extend(activation_map_row)
  return flattened_activation_maps