Hello
I just stumbled upon the following problem. When creating a tensor from a scalar or sequence, with requiresGrad=true, the value of the argument is lost. The following code exposes the problem
val x = Tensor(Seq(1.0f), requiresGrad = true)
assert(x.requiresGrad == true)
Setting the parameter explicitly with x.requiresGrad(true) works.
I looked into the problem but could not spot anything wrong. It seems to get lost in this line
The problem persists when using the latest pytorch version (2.5.1). Does anybody know what could be the problem?
Hello
I just stumbled upon the following problem. When creating a tensor from a scalar or sequence, with
requiresGrad=true, the value of the argument is lost. The following code exposes the problemSetting the parameter explicitly with
x.requiresGrad(true)works.I looked into the problem but could not spot anything wrong. It seems to get lost in this line
The problem persists when using the latest pytorch version (2.5.1). Does anybody know what could be the problem?