MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / _backshift_permutation

Function _backshift_permutation

python/paddle/tensor/linalg.py:720–729  ·  view source on GitHub ↗

Auxiliary function for matrix_norm Computes the permutation that moves the two given dimensions to the back

(dim0, dim1, dimn)

Source from the content-addressed store, hash-verified

718 """
719
720 def _backshift_permutation(dim0, dim1, dimn):
721 """
722 Auxiliary function for matrix_norm
723 Computes the permutation that moves the two given dimensions to the back
724 """
725 pos_dim0 = dim0 % dimn
726 pos_dim1 = dim1 % dimn
727 ret = [i for i in range(dimn) if i != pos_dim0 and i != pos_dim1]
728 ret.extend((pos_dim0, pos_dim1))
729 return ret
730
731 def _inverse_permutation(perm):
732 """

Callers 2

nuclear_normFunction · 0.85
p_matrix_normFunction · 0.85

Calls 2

rangeFunction · 0.85
extendMethod · 0.45

Tested by

no test coverage detected