def get_machine_type(cpu_cores, memory, accelerator_type):
    """Returns the GCP AI Platform machine type."""
    if accelerator_type.value == "TPU_V2" or accelerator_type.value == "TPU_V3":
        return "cloud_tpu"
    machine_type_map = {
        (4, 15): "n1-standard-4",
        (8, 30): "n1-standard-8",
        (16, 60): "n1-standard-16",
        (32, 120): "n1-standard-32",
        (64, 240): "n1-standard-64",
        (96, 360): "n1-standard-96",
        (2, 13): "n1-highmem-2",
        (4, 26): "n1-highmem-4",
        (8, 52): "n1-highmem-8",
        (16, 104): "n1-highmem-16",
        (32, 208): "n1-highmem-32",
        (64, 416): "n1-highmem-64",
        (96, 624): "n1-highmem-96",
        (16, 14.4): "n1-highcpu-16",
        (32, 28.8): "n1-highcpu-32",
        (64, 57.6): "n1-highcpu-64",
        (96, 86.4): "n1-highcpu-96",
    }
    return machine_type_map[(cpu_cores, memory)]