Hi,
Suppose I’ve a code block wrapped with torch no grad and I call a function that does inference in it, i.e,

with torch.no_grad():
    my_infer(my_model, my_data)

should I use with

torch.no_grad()

at the beginning of my_infer() too or is the outer no_grad  sufficient?