Strange error when I try to define my own operator #403
-
I was trying to add to the model an unary operator to return a value from a Gaussian distribution, so I coded something like this:
but this would raise a runtime error: Therefore, I changed my code to:
This produced another error: This error makes no sense because the function I wrote should be able to accept any real numbers. Anyway, I altered my code again:
It was yet giving the same error: I am stuck at this point, does anyone have some advice on this? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
If you are using
|
Beta Was this translation helpful? Give feedback.
If you are using
precision=32
(default), then your operators have to use onlyFloat32
. So either useprecision=64
, or write your operator like this: