check_perturbation_index#
- t3toolbox.backend.sampling_derivatives.check_perturbation_index(index, pp, shape=None)#
def check_perturbation_index( index: NDArray, # grid points, int, shape=(d,)+W pp: typ.Sequence[NDArray], # perturbation P, len=d, elm_shape=W+(Ni,) shape: typ.Optional[typ.Sequence[int]] # ambient mode dims (Ni), len=d -- if given, also check P's mode dim = None, ) -> None:
Structural check (hard error): the perturbation
Pshares the sample stackWof the grid pointsindex(shape(d,)+W), and – whenshapeis given (the ambient mode dimsNi, which the integerindexdoes not carry) –P’s mode dim matches it. Used by the derivative-entries frontends; jit-safe.