def required_resources_for_method(method, uses_pretrained_r_net):
  """Returns the required resources for the given training method.

  Args:
    method: str, training method.
    uses_pretrained_r_net: bool, whether we use pre-trained r-net.

  Returns:
    Tuple (RAM (MBs), num CPUs, num GPUs)
  """
  if method == 'ppo_plus_eco':
    # We need to rent 2 GPUs, because with this amount of RAM, GCP won't allow
    # us to rent only one.
    return (105472, 16, 2)
  if method == 'ppo_plus_ec' and not uses_pretrained_r_net:
    return (52224, 12, 1)
  return (32768, 12, 1)