Skip to content

Commit

Permalink
type -> device
Browse files Browse the repository at this point in the history
`type()` is depreciated and it looks like `device()` is appropriate
here. There are other `type` commands below and the error message says
that `option` can be a drop-in but I'm unsure if this is appropriate for
those calls.
  • Loading branch information
stevenwalton committed Mar 9, 2022
1 parent 7db879f commit fee1859
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion advanced_source/cpp_extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ We'll start with the C++ file, which we'll call ``lltm_cuda.cpp``, for example:
// C++ interface
#define CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
#define CHECK_CUDA(x) TORCH_CHECK(x.device().is_cuda(), #x " must be a CUDA tensor")
#define CHECK_CONTIGUOUS(x) TORCH_CHECK(x.is_contiguous(), #x " must be contiguous")
#define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
Expand Down

0 comments on commit fee1859

Please sign in to comment.