simplify bool

This commit is contained in:
Andrej Karpathy 2024-04-22 00:19:00 +00:00
parent a332ea5d92
commit 4e4eba0441

View file

@ -403,7 +403,7 @@ if __name__ == "__main__":
write_model(model, "gpt2_124M.bin")
write_state(model, x, y, logits, loss, "gpt2_124M_debug_state.bin")
use_fused = True if device == "cuda" else False
use_fused = device == "cuda" # only works on CUDA (?)
optimizer = torch.optim.Adam(model.parameters(), lr=1e-4, fused=use_fused)
timings = []
if device == "cuda":