Closed raphaelDkhn closed 9 months ago
Hello! a fix related to this problem was recently merged in the cairo repo, I already applied it to our mirrored code in PR #1551. Running cargo run ../cairo_programs/cairo-1-programs/tensor.cairo --layout all_cairo --args '[2 2] [1 2 3 4]'
should now work. (Note: the Tensor
struct consists of two spans, so we need to input two separate arrays, --args '[2 2 1 2 3 4]'
will not work)
Thank you a lot, it's working well !
Describe the bug
Hello @fmoletta, I've come across an issue with your PR #1551 in the cairo1-run environment.
When running the command cargo run ../cairo_programs/cairo-1-programs/with_input/tensor_test.cairo --layout all_cairo --args '[2 2 2 4 1 2 3 4]', an error occurs:
The Cairo program used is as follows:
Notably, when the Tensor is initialized inside the main function instead of being passed as an argument, the program runs without issues:
Moreover, when I modify the main function to simply return the passed Tensor, like this:
It works correctly, which suggests that the argument passing mechanism for structs is functioning well.
What version/commit are you on? Current Version/Commit: Branch
cairo-1-input-args