We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
setindex!
@trace
using Reactant function condition10_condition_with_setindex(x) @trace if sum(x) > 0 x[:, 1] = -1.0 else x[1, 1] = 1.0 end return x end x = rand(2, 10) x_ra = Reactant.to_rarray(x) res_ra = @jit(condition10_condition_with_setindex(x_ra)) @test res_ra[1, 1] == -1.0 @test res_ra[2, 1] == -1.0 @test x_ra[1, 1] == -1.0 broken = true @test x_ra[2, 1] == -1.0 broken = true x = -rand(2, 10) x[2, 1] = 0.0 x_ra = Reactant.to_rarray(x) res_ra = @jit(condition10_condition_with_setindex(x_ra)) @test res_ra[1, 1] == 1.0 @test res_ra[2, 1] == 0.0 @test x_ra[1, 1] == 1.0 broken = true @test x_ra[2, 1] == 0.0
The text was updated successfully, but these errors were encountered:
Fixing this one will likely be a prerequisite to doing for loops [since those will almost certainly want to update things in place in practice]
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: