eagerpy
eagerpy copied to clipboard
PyTorch, TensorFlow, JAX and NumPy — all of them natively using the same code
Bumps [numpy](https://github.com/numpy/numpy) from 1.19.5 to 1.22.0. Release notes Sourced from numpy's releases. v1.22.0 NumPy 1.22.0 Release Notes NumPy 1.22.0 is a big release featuring the work of 153 contributors spread...
Closes #21 Implements `eagerpy.diag`, following `numpy` / `torch` convention: - Given a one-dimensional tensor, returns a two-dimensional tensor whose diagonal contains the input tensor values, and all other entries are...
Introduce as_tensors, as_tensors_, as_raw_tensor, as_raw_tensors that rely in tree_flatten/tree_unflatten for more generic usages JaxTensor is no longer registered as a pytree datastructure Refactor JaxTensor._value_and_grad_fn Fix https://github.com/jonasrauber/eagerpy/issues/34
Hello, my goal is to work around https://github.com/pytorch/pytorch/issues/34452 . ```python import torch import numpy as np import eagerpy as ep t=ep.astensor(torch.tensor([0.])) i=np.array([[0,0],[0,0]]) t[i] t[ep.astensor(i)] ``` Currently, the last 2 lines...
I noticed that the method `index_update` seems very slow for tensorflow backend when used in compiled code (a function wrapped with `tf.function`). It could be worth to see how we...
Let's consider a simple compiled function in tensorflow. ```python import tensorflow as tf a = tf.random.normal(shape=(2, 10)) b = tf.random.normal(shape=(10, 3)) @tf.function def tf_compiled_func(a, b): c = tf.matmul(a, b) return...
In order to simplify the writting of universal functions it could be great to have a decorator function which hide the technical part of the code (convertion of input and...
I think it would be good to have an eagerpy version of the `nonzero()` and `flatnonzero()` functions. I guess these can be imitated with a combination of `arange` and indexing,...
**Feature Request** Would is be possible to support python scalars? eg. ```python3 num_float = ep.astensor(1.0) num_int = ep.astensor(42) ``` **Why?** This would be helpful for implementing generic functions, for example:...
Converting between things like float32/64/int32/64 would be a really nice addition!