I am modifying
identity_3d which is initialized as an
n numpy array per the following operations:
identity_3d = np.zeros((n, n, n))
idx = np.arange(n)
identity_3d[:, idx, idx] = 1
I,J = np.nonzero(wR==0)
identity_3d was an Tensor instead, is there a way to perform the equivalent operation?
Do you have a complete numpy running example?
There is not a direct slice assigment for Tensor that maps the numpy syntax.
As you can see is currently not available also in the TF experimental numpy API:
But It Is a very frequent topic, take a look at: