Chalkboard - v3.1.0
    Preparing search index...

    Function permute

    • Calculates the permutation of the axes of a tensor, so that axis k of the result is axis axes[k] of the tensor (as in NumPy's transpose with an axes argument).

      Parameters

      • tens: ChalkboardTensor

        The tensor

      • ...axes: number[]

        The order of the axes, as a permutation of the integers from 0 to the tensor rank minus one, either as a sequence of arguments or one array

      Returns ChalkboardTensor

      const result = Chalkboard.tens.permute([[[1, 2, 3]], [[4, 5, 6]]], 2, 0, 1); // Returns [[[1], [4]], [[2], [5]], [[3], [6]]]