SciNim / flambeau

Nim bindings to libtorch
85 stars 3 forks source link

Operation on Tensor with different shape cause a segfault #21

Closed Clonkk closed 3 years ago

Clonkk commented 3 years ago

It should throw an exception instead

block:
      let shape2 = [8'i64, 8'i64]
      let shape3 = [7'i64, 8'i64]
      var f64input2 = rand(shape2.asTorchView(), kfloat64)
      var f64input3 = rand(shape3.asTorchView(), kfloat64)
      echo f64input2 + f64input3
Clonkk commented 3 years ago

By construction of the higher level API Tensor[T], only the low-level bindings have this issue, si this will be marked as a won't fix.