corewise_zeros_like#

t3toolbox.corewise.corewise_zeros_like(X)#
def corewise_zeros_like(
        X:  NDArrayTree,  # any nested tree of ints/floats/arrays
) -> NDArrayTree:         # zeros with X's tree structure and leaf shapes (numpy/jax inferred from X)

Tree of zeros matching X’s structure and leaf shapes/backend (= corewise_scale(X, 0)).

Examples

>>> import numpy as np
>>> import t3toolbox.corewise as cw
>>> X = (np.ones(3), (1.0, (), np.ones(2)))
>>> print(cw.corewise_zeros_like(X))
(array([0., 0., 0.]), (0.0, (), array([0., 0.])))
Parameters:

X (NDArrayTree)

Return type:

NDArrayTree