quantdata.jax.bbjax#

Jax Backbone#

Numerical backbone for jax operations.

class quantdata.jax.bbjax.BackboneJax(env='cpu')[source]#

Bases: Backbone

Jax compute backbone

norm_cdf(arr)[source]#
to_atomic(data, dtype=None)[source]#

Convert data to a scalar tensor. Stops gradient calculation if data is a tensor.

to_array(data, dtype=None)[source]#

Create an array; do not copy if data is already an array of the correct dtype and on the correct device. Stops gradient calculation if data is a tensor

to_numpy(arr)[source]#
stop_gradient(arr)[source]#

Stop gradient calculation. Does NOT make a copy

zeros(shape, dtype)[source]#
empty(shape, dtype)[source]#
zeros_like(arr, dtype=None)[source]#
empty_like(arr, dtype=None)[source]#
unique(arr, axis=-1)[source]#
take_along_axis(arr, indices, axis)[source]#
verify(condition, message, exception=<class 'RuntimeError'>)[source]#

Verify a condition, raise an error with message if not satisfied.

are_broadcastable(*shapes)[source]#

Check if shapes are broadcastable according to torch/numpy broadcasting rules.

stack(arrays, axis=0, dtype=None)[source]#

Stack arrays along a new axis. If dtype is provided, cast to dtype after stacking.