MCPcopy Index your code
hub / github.com/apache/tvm / view

Method view

web/src/runtime.ts:576–587  ·  view source on GitHub ↗

* Create a view of the array. * @param shape The shape of the view. * @param dtype The data type of the new array. * @returns The new sliced ndarray.

(shape: Array<number>, dtype?: string)

Source from the content-addressed store, hash-verified

574 * @returns The new sliced ndarray.
575 */
576 view(shape: Array<number>, dtype?: string): Tensor {
577 const shapeArray = shape.map((value) => new Scalar(value, "int"));
578 if (dtype === undefined) {
579 dtype = this.dtype;
580 }
581 return this.ctx.tensorCreateView(
582 this,
583 this.ctx.makeShapeTuple(...shapeArray),
584 this.dtype,
585 /*relative_byte_offset=*/ new Scalar(0, "int"),
586 );
587 }
588 /**
589 * Get dataPtr of NDarray
590 *

Callers 15

forwardMethod · 0.45
mainMethod · 0.45
mainMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
explicit_sinfoFunction · 0.45
inferred_sinfoFunction · 0.45
funcFunction · 0.45
mainMethod · 0.45
mainMethod · 0.45

Calls 1

makeShapeTupleMethod · 0.80

Tested by 15

forwardMethod · 0.36
mainMethod · 0.36
mainMethod · 0.36
forwardMethod · 0.36
forwardMethod · 0.36
explicit_sinfoFunction · 0.36
inferred_sinfoFunction · 0.36
funcFunction · 0.36
mainMethod · 0.36
mainMethod · 0.36