From 4e9ca28a71dca90e19a15b2103bdc3d0db6ffd9c Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 11 Apr 2023 18:24:43 -0700 Subject: Update documentation for `TorchTensor.alloc`. --- docs/user-guide/a1-02-slangpy.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/user-guide/a1-02-slangpy.md b/docs/user-guide/a1-02-slangpy.md index dd218cd95..880db7ca6 100644 --- a/docs/user-guide/a1-02-slangpy.md +++ b/docs/user-guide/a1-02-slangpy.md @@ -409,7 +409,8 @@ Following is a list of builtin methods and attributes for PyTorch interop. ### `TorchTensor` methods #### `static TorchTensor TorchTensor.alloc(uint x, uint y, ...)` -Allocates a new PyTorch tensor with the given dimensions. +Allocates a new PyTorch tensor with the given dimensions. If `T` is a vector type, the length of the vector is implicitly included as the last dimension. +For example, `TorchTensor.alloc(4, 4)` allocates a 3D tensor of size `(4,4,3)`. #### `static TorchTensor TorchTensor.emptyLike(TorchTensor other)` Allocates a new PyTorch tensor that has the same dimensions as `other` without initializing it. -- cgit v1.2.3