-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ONNXRunTime.jl has no bool type #112
Comments
I guess If you are sure that your implementation works, correctly, it's perfectly fine to make a PR and add a broken test with a comment linking to this issue. It may also be worth to raise a corresponding issue in ONNXRunTime.jl repo for visibility. |
Do I understand it right that you can write an ONNX graph (file) with |
Yes, I ONNX.jl will compile and run but the testsets will not. Is ort_test relatively easy to run on Python? (Assuming it exports the layer, compare the output of the Julia function and the onnx layer, and returns the comparison?) |
Implementing |
After changing some comments and adding a Datatype support for Bool I now get an error when running my test. Am I improperly supporting Numpy-like broadcasting? |
Hm, I'm not sure I understand the logic of your implementation. Copying here for simplicity: function and(x, y)
if (size(x)[2] == size(y)[1] && size(x)[1] == size(y)[2])
z = permutedims(x)
return y .&& z
end
return y .&& x
end At least it seems ambiguous in cases of square matrices and multidimensional (N > 2) inputs. |
It seems ambiguous because, I think, It is ambiguous. function and(x, y)
# Arguments switched as Julia is row-major
return y .&& x
end in the REPL, and works on the two following Matrix{Bool} X = convert(Matrix{Bool}, [0 1 0; 1 1 0; 0 1 1; 1 1 1])
Y = convert(Matrix{Bool}, [1 0 0; 1 0 0; 0 0 1; 1 1 0]) and that single test case passes The two following Matrix{Bool} are not broadcasted in the X = convert(Matrix{Bool}, [0 1 0; 1 1 0; 0 1 1; 1 1 1])
Y = convert(Matrix{Bool}, [1 0 0 1; 0 0 0 0; 1 1 1 0]) have I misunderstood input shapes? do they always have to have one common axis, as in 1x30, 1x10 or 4x3, 8x3? I was under the impression that numpy-like broadcasting meant a 4x3 matrix could be added to a 3x4 matrix (or any other arithmatic, element-wise computation) |
Hello!
Im trying to implement the ONNX layer 'And' which takes two Boolean tensors in and uses logical and elementwise and returns a single Boolean tensor.
Unfortunately, unless I have coded this test set wrong, there is currently no implementation in ONNXRunTime.jl for tensor type bool (why is it commented out?).
Here is my test code.
src/ops.jl:
test/saveload.jl:
load.jl and save.jl were omited but if you need them to reproduce the issue, they can be found here.
Here is the error I get during testing.
The text was updated successfully, but these errors were encountered: