def METHOD_NAME(model: 'torchbenchmark.util.model.BenchmarkModel', dargs: argparse.Namespace):
    if dargs.channels_last:
        model.enable_channels_last()
    if dargs.precision == "fp16":
        model.enable_fp16_half()
    elif dargs.precision == "tf32":
        import torch
        torch.backends.cuda.matmul.allow_tf32 = True
        torch.backends.cudnn.allow_tf32 = True
    elif dargs.precision == "amp":
        # model handles amp itself if it has 'enable_amp' callback function (e.g. pytorch_unet)
        if hasattr(model, "enable_amp"):
            model.enable_amp()
    elif dargs.precision == "fx_int8":
        assert model.device == "cpu" and model.test == "eval", f"fx_int8 only work for eval mode on cpu device."
        model.enable_fx_int8(dargs.quant_engine)
    elif dargs.precision == "bf16":
        assert model.device == "cpu", f"bf16 only work on cpu device."
        model.enable_bf16()
    elif dargs.precision == "amp_fp16":
        assert model.device == "cuda", f"{model.device} has no fp16 autocast."
        if model.test == "eval":
            import torch
            model.add_context(lambda: torch.cuda.amp.autocast(dtype=torch.float16))
        elif model.test == "train":
            # the model must implement staged train test
            assert is_staged_train_test(model), f"Expected model implements staged train test (forward, backward, optimizer)."
            import torch
            model.add_context(lambda: torch.cuda.amp.autocast(dtype=torch.float16), stage=TEST_STAGE.FORWARD)
    elif dargs.precision == "amp_bf16":
        import torch
        model.add_context(lambda: torch.cpu.amp.autocast(dtype=torch.bfloat16))
    elif not dargs.precision == "fp32":
        assert False, f"Get an invalid precision option: {dargs.precision}. Please report a bug."