-
- Downloads
Adjust TensorflowVector square and square root computations.
For some reason, `tf.square(x)` and `tf.pow(x, 2)` can result in distinct values for small-enough values of x. The same is true of `tf.sqrt(x)` and `tf.pow(x, 0.5)`. This commit ensures the `tf.sqrt` and `tf.square` functions are used in these two edge cases for the `vector ** p` syntax. This choice is motivated by the fact that these functions are used in most official tensorflow / keras code, and seem to be closer to their torch counterparts (which are equivalent to `vec ** p`) than `tf.pow` - based on a few local tests.
Loading
Please register or sign in to comment