Skip to content

Instantly share code, notes, and snippets.

@ryantm
Created January 27, 2022 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryantm/de7bbc79ee2623ab48a835924d60c8ca to your computer and use it in GitHub Desktop.
Save ryantm/de7bbc79ee2623ab48a835924d60c8ca to your computer and use it in GitHub Desktop.
NMatrix default value NaN
> d = NMatrix.new([1,1],0.0, stype: :yale) / NMatrix.new([1,1],0.0, stype: :yale)
#<NMatrix:0x00000000074cd2e8 shape:[1,1] dtype:float64 stype:yale capacity:3>
> d.dot(d)
*** NotImplementedError Exception: matrix default value must be some form of zero (not false or nil) for multiplication
nil
> d.default_value
NaN
> d.cast_full(:yale, :float64, 0.0).default_value
NaN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment