A sample code
for curFeature in range(X.shape[1]):     
    model1Obj.zero_grad()
    print("Size of x1 is {0}".format(X.shape))
    # Alter the feature before you calculate the loss
    mu,sigma=norm.fit(X[:,curFeature])
    Y=copy.deepcopy(X)
    Y[:,curFeature]=np.random.normal(mu, sigma, 100)
    Y=Variable(torch.from_numpy(Y))
    output=model1Obj(Y)
    loss=criterion(target,output)
    print("The loss value for feature {0} is {1}".format(curFeature,loss.item()))

Hope this helps