From 8dac466b9c672dd708b8e5ab1620b5029467fdd7 Mon Sep 17 00:00:00 2001 From: zhaochaoxing <109726331+zhaochaoxing@users.noreply.github.com> Date: Fri, 3 Nov 2023 14:35:39 +0800 Subject: [PATCH] Temporary support for PyTorch 2.1 (#395) --- dipu/torch_dipu/csrc_dipu/runtime/core/DIPUGeneratorImpl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dipu/torch_dipu/csrc_dipu/runtime/core/DIPUGeneratorImpl.h b/dipu/torch_dipu/csrc_dipu/runtime/core/DIPUGeneratorImpl.h index 333a36ab4..be201ef3e 100644 --- a/dipu/torch_dipu/csrc_dipu/runtime/core/DIPUGeneratorImpl.h +++ b/dipu/torch_dipu/csrc_dipu/runtime/core/DIPUGeneratorImpl.h @@ -19,7 +19,9 @@ class DIPUGeneratorImpl : public c10::GeneratorImpl { uint64_t seed() override; static at::DeviceType device_type(); c10::intrusive_ptr get_state() const override; - virtual void set_state(const c10::TensorImpl& state) {} + virtual void set_state(const c10::TensorImpl& state) {}; + virtual void set_offset(uint64_t offset) {}; + virtual uint64_t get_offset() const {return 0;}; protected: void set_state_flag(bool flag);