class Drop_attr3(nn.Module):
    def __init__(self):
        super(Drop_attr3, self).__init__()
    def forward(self,x,adj):
        row = x.size()[0]
        i = random.randint(0, row-1)
        x = make_zero_row(x,i)
        return x ,adj
def make_zero_row(x,row):
    torch.zero_(x[row])
    return x

here is my model.when I try to train it , the error is reported as “one of the variables needed for gradient computation has been modified by an inplace operation”, i want to know how to set one row of the tensor to ‘0’ without having inplace problems .
I’d appreciate some help!