Skip to content

Commit

Permalink
Update to torch 2.6 api (#1326)
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeiteng authored Feb 8, 2025
1 parent 1cf8844 commit 0a09f67
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions k2/csrc/pytorch_context.cu
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ class PytorchCudaContext : public Context {
// so it is fine to invoke lazyInitCUDA() multiple times.
// The call will be inlined since it is defined in the header
// aten/src/ATen/Context.h
#if K2_TORCH_VERSION_MAJOR > 2 || (K2_TORCH_VERSION_MAJOR == 2 && K2_TORCH_VERSION_MINOR >= 6)
at::globalContext().lazyInitDevice(torch::kCUDA);
#else
at::globalContext().lazyInitCUDA();
#endif

allocator_ = c10::cuda::CUDACachingAllocator::get();
K2_CHECK(allocator_->raw_deleter() != nullptr);
Expand Down

0 comments on commit 0a09f67

Please sign in to comment.