Error with hook functions

Hello everyone, I have a question about hook functions:

After executing the following code:

def relu_backward_deconv_hook(module, grad_input, grad_output): 
    return nn.functional.relu(grad_output[0])

def equip_model_deconv(model): 
    for m in model.modules():
        if isinstance(m, nn.ReLU): 

def grad_view(model, image_name):
    to_tensor = transforms.ToTensor()
    img = to_tensor(
    img = img[:,0:224,0:224]
    img = 0.5 + 0.5 * (img - img.mean()) / img.std()'cuda:0')
    img ='cuda:0')
    input1 = img.view(1, img.size(0), img.size(1), img.size(2)).requires_grad_() 
    output = model(input1)
    result = torch.autograd.grad(output.max(), input1)
    result = result / result.max() + 0.5
    return result

model = models.vgg16(pretrained = True) 
model = model.features 

result = grad_view(model, "/home/ubuntu/folder/mug.jpg") 
utils.save_image(result, 'mug-vgg16-deconv.png')

I get this error: TypeError: expected tuple, but hook returned ‘Tensor’

Could you figure out the problem that I’m having?

Thank you in advance!