Is this really the recommended way to initialise a tensor’s value?
torch::NoGradGuard guard;
tensor[0] = value;
Is this really the recommended way to initialise a tensor’s value?
torch::NoGradGuard guard;
tensor[0] = value;
No. If you need a tensor with value, use torch::full
.