Exponentiation on int32 data with base 0 gives different results when jitted
See original GitHub issueExample
from jax import numpy as jnp
import jax
EXP_MULTIPLIER = 1
def power(a, b):
return a**b
a = jnp.int32(0)
b = jnp.int32(EXP_MULTIPLIER * 64)
result = power(a, b)
result_jit = jax.jit(power)(a, b)
assert result == result_jit, f'{result} != {result_jit}'
AssertionError: 0 != 1
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
strange behavior when casting the result float to int
gives the result of 619999980 so (Int32)(6.2f * 10) gives 61. It's different when two Single are multiplied, in that case there is...
Read more >Compiling Python code with @jit - Numba documentation
int32 (int32, int32) is the function's signature. In this case, the corresponding specialization will be compiled by the @jit decorator, and no other...
Read more >12.5.1. Exponential and Logarithmic Functions
If the base-number is of type rational and the power-number is an integer, ... If the power-number is a zero of any other...
Read more >Troubleshooting and tips — Numba 0.50.1 documentation
There can be various reasons why Numba cannot compile your code, and raises an error instead. One common reason is that your code...
Read more >Basic rules for exponentiation - Math Insight
A brief overview of the basic rules for exponents or powers. ... Here, x is the base and n is the exponent or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fix is in #5990
I’ll try to get a fix in this morning.