I know about the conversion you mentioned in your answer. But what should be done to these lines in engine.py. Should I keep it as it is?
    # reduce losses over all GPUs for logging purposes
    loss_dict_reduced = utils.reduce_dict(loss_dict)
    losses_reduced = sum(loss for loss in loss_dict_reduced.values())

I have added another question please take look at that. Thanks for answering my questions.