Looking at the code you are trying to run, optimizer.zero_grad() is probably located in engine/train_one_epoch and you will also need to edit the forward function in the actual model.
See Automatic Mixed Precision examples — PyTorch 1.7.0 documentation for use case examples.
I want to point out that it might be difficult to correctly enable AMP if you are unfamiliar with the code you are trying to run and it is not guaranteed that you can fit the model and data into GPU mem even after enabling it.
Another course of action could therefore be to add a transform to downscale the images you are training the model on in get_transform. There you could append this: torchvision.transforms — PyTorch 1.7.0 documentation and experiment a bit with sizes. By downscaling the size of the image it is possible that you could run the model on your graphic card.