UniformTuckerTensorTrain.entries#
- t3toolbox.uniform_tucker_tensor_train.UniformTuckerTensorTrain.entries(index)#
def entries( self, index: NDArray, # int, shape=(d,)+idx_stack (one multi-index per idx_stack element) ) -> NDArray: # shape=idx_stack+stack_shape
Entry/entries of the represented dense tensor, evaluated without forming it (shares
ut3_entries()).Precondition-free (exact for any cores). Uniform mirror of
entries().Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> import t3toolbox.uniform_tucker_tensor_train as ut3 >>> np.random.seed(0) >>> x = ut3.UniformTuckerTensorTrain.from_t3(t3.TuckerTensorTrain.randn((10, 11, 12), (5, 6, 4), (1, 2, 3, 1))) >>> print(bool(abs(float(x.entries((3, 5, 7))) - float(x.to_dense()[3, 5, 7])) < 1e-9)) True