@thi.ng/tensors
Version:
0D/1D/2D/3D/4D tensors with extensible polymorphic operations and customizable storage
16 lines • 483 B
TypeScript
import type { ITensor } from "./api.js";
import { Tensor1 } from "./tensor.js";
/**
* Returns a 1D tensor view of the nD diagonal of the given tensor.
*
* @remarks
* For 1D tensors this will merely by a shallow copy.
*/
export declare const diagonal: <T>(a: ITensor<T>) => Tensor1<T>;
/**
* Computes the trace of given tensor, i.e. the component sum of `diagonal(a)`.
*
* @param a
*/
export declare const trace: (a: ITensor) => number;
//# sourceMappingURL=diagonal.d.ts.map