mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Fix internal build
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78282 Approved by: https://github.com/davidberard98
This commit is contained in:
committed by
PyTorch MergeBot
parent
5e03dfd36d
commit
13e444bfa5
@ -42,10 +42,6 @@ static c10::Device noop_device_fn(const PyInterpreter*, const TensorImpl*) {
|
||||
"attempted to device Tensor with nontrivial PyObject after corresponding interpreter died");
|
||||
}
|
||||
|
||||
c10::Device PyInterpreter::device(const TensorImpl* self) const {
|
||||
return (*device_fn_)(this, self);
|
||||
}
|
||||
|
||||
void PyInterpreter::disarm() noexcept {
|
||||
name_fn_ = &noop_name_fn;
|
||||
decref_fn_ = &noop_decref_fn;
|
||||
|
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <c10/core/Device.h>
|
||||
#include <c10/macros/Macros.h>
|
||||
#include <c10/util/intrusive_ptr.h>
|
||||
#include <c10/util/python_stub.h>
|
||||
@ -13,7 +14,6 @@ struct IValue;
|
||||
class OperatorHandle;
|
||||
struct TensorImpl;
|
||||
struct SafePyObject;
|
||||
struct Device;
|
||||
} // namespace c10
|
||||
|
||||
namespace torch {
|
||||
@ -188,7 +188,9 @@ struct C10_API PyInterpreter {
|
||||
return (*is_contiguous_fn_)(this, self);
|
||||
}
|
||||
|
||||
__ubsan_ignore_function__ c10::Device device(const TensorImpl* self) const;
|
||||
__ubsan_ignore_function__ c10::Device device(const TensorImpl* self) const {
|
||||
return (*device_fn_)(this, self);
|
||||
}
|
||||
|
||||
// Disarm this PyInterpreter, making all of its methods noops.
|
||||
// Because the function pointers are raw pointers (not atomics),
|
||||
|
Reference in New Issue
Block a user