I have a code in which  following line is written but when I ran it, some warnings occurred quoting use no_grad.
What should I do for this command? Please tell the alternate.
def batchrun(image_batch, model):
image_batch = torch.FloatTensor(image_batch).cuda()
image_batch = torch.autograd.Variable(image_batch, volatile=True)
feats = model(image_batch)
feats = feats.data.cpu().clone().numpy()
return feats