* 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)
)
| 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. |