MCPcopy Index your code
hub / github.com/tensorflow/tfjs / constructor

Method constructor

tfjs-core/src/tensor.ts:288–296  ·  view source on GitHub ↗
(shape: ShapeMap[R], dtype: DataType, dataId: DataId, id: number)

Source from the content-addressed store, hash-verified

286 readonly strides: number[];
287
288 constructor(shape: ShapeMap[R], dtype: DataType, dataId: DataId, id: number) {
289 this.shape = shape.slice() as ShapeMap[R];
290 this.dtype = dtype || 'float32';
291 this.size = util.sizeFromShape(shape);
292 this.strides = computeStrides(shape);
293 this.dataId = dataId;
294 this.id = id;
295 this.rankType = (this.rank < 5 ? this.rank.toString() : 'higher') as R;
296 }
297
298 get rank(): number {
299 return this.shape.length;

Callers

nothing calls this directly

Calls 3

computeStridesFunction · 0.90
toStringMethod · 0.80
sliceMethod · 0.65

Tested by

no test coverage detected