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

Method empty

web/src/runtime.ts:1502–1509  ·  view source on GitHub ↗

* Create an empty Tensor with given shape and dtype. * * @param shape The shape of the array. * @param dtype The data type of the array. * @param dev The device of the ndarray. * @returns The created ndarray.

(
    shape: Array<number> | number,
    dtype: string | DLDataType = "float32",
    dev: DLDevice = this.device("cpu", 0)
  )

Source from the content-addressed store, hash-verified

1500 * @returns The created ndarray.
1501 */
1502 empty(
1503 shape: Array<number> | number,
1504 dtype: string | DLDataType = "float32",
1505 dev: DLDevice = this.device("cpu", 0)
1506 ): Tensor {
1507 shape = typeof shape === "number" ? [shape] : shape;
1508 return this.ctx.tensorEmpty(this.makeShapeTuple(shape), dtype, dev, null);
1509 }
1510
1511 /**
1512 * Create am uniform {@link Tensor} with given shape.

Callers 15

uniformMethod · 0.95
verify_torch_dlpackFunction · 0.45
verify_group_gemmFunction · 0.45
test_localFunction · 0.45
check_remoteFunction · 0.45
test_bodyFunction · 0.45
forwardMethod · 0.45
forwardMethod · 0.45

Calls 2

deviceMethod · 0.95
makeShapeTupleMethod · 0.95

Tested by 15

verify_torch_dlpackFunction · 0.36
verify_group_gemmFunction · 0.36
test_localFunction · 0.36
check_remoteFunction · 0.36
test_bodyFunction · 0.36
forwardMethod · 0.36
forwardMethod · 0.36
forwardMethod · 0.36
create_kv_cacheFunction · 0.36