@thi.ng/tensors
Version:
0D/1D/2D/3D/4D tensors with extensible polymorphic operations and customizable storage
28 lines • 887 B
TypeScript
import type { NumType, TensorOpts } from "./api.js";
import { Tensor1 } from "./tensor.js";
export interface RangeOpts<T extends NumType> extends Pick<TensorOpts<T, [number]>, "storage"> {
/**
* Tensor data type.
*
* @defaultValue "num"
*/
type: T;
}
/**
* Creates a 1D tensor of monotonically increasing values in the interval `[0,max)`.
*
* @param max
* @param opts
*/
export declare function range<T extends NumType>(max: number, opts?: RangeOpts<T>): Tensor1;
/**
* Creates a 1D tensor of monotonically increasing values in the interval
* `[min,max)`, using optional `step` and `opts`. If `from <= to`, the default
* step is 1, otherise -1.
*
* @param from
* @param to
* @param opts
*/
export declare function range<T extends NumType>(from: number, to: number, step?: number, opts?: RangeOpts<T>): Tensor1;
//# sourceMappingURL=range.d.ts.map