Skip to content

Commit

Permalink
Fix missing class in cpp tensor documentation (#54488)
Browse files Browse the repository at this point in the history
Summary:
The given example in the documentation does not compile due to the missing `torch::`. It is correct in the tutorial about [writing a custom extension ](https://pytorch.org/tutorials/advanced/cpp_extension.html#writing-a-mixed-c-cuda-extension)

Pull Request resolved: #54488

Reviewed By: bdhirsh

Differential Revision: D27267000

Pulled By: glaringlee

fbshipit-source-id: 86a46d656c1a4fa4098287a6a43a38d1ef80171e
  • Loading branch information
dirkkul authored and facebook-github-bot committed Mar 24, 2021
1 parent f9ca0d8 commit 12a61a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/cpp/source/notes/tensor_basics.rst
Expand Up @@ -76,7 +76,7 @@ CUDA accessors
.. code-block:: cpp
__global__ void packed_accessor_kernel(
PackedTensorAccessor64<float, 2> foo,
torch::PackedTensorAccessor64<float, 2> foo,
float* trace) {
int i=threadIdx.x
gpuAtomicAdd(trace, foo[i][i])
Expand Down

0 comments on commit 12a61a1

Please sign in to comment.