mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Revert "Don't use deprecated type properties in UpsampleKernel (#139399)"
This reverts commit 0058f7100222523fa8b9f74af9ea7d341a6458b4. Reverted https://github.com/pytorch/pytorch/pull/139399 on behalf of https://github.com/malfet due to And it was backed out again due to the internal usages of deprecated API ([comment](https://github.com/pytorch/pytorch/pull/139358#issuecomment-2459740090))
This commit is contained in:
@ -586,7 +586,7 @@ PickleOpCode Unpickler::readInstruction() {
|
||||
storage = storage_context_->getStorage(key);
|
||||
} else {
|
||||
int64_t numel = args.at(4).toInt();
|
||||
auto dtype = scalarTypeToTypeMeta(type);
|
||||
caffe2::TypeMeta dtype = at::CPU(type).typeMeta();
|
||||
|
||||
at::DataPtr storage_ptr;
|
||||
if (numel > 0) {
|
||||
@ -608,7 +608,7 @@ PickleOpCode Unpickler::readInstruction() {
|
||||
}
|
||||
}
|
||||
|
||||
auto options = at::device(at::kCPU).dtype(type);
|
||||
auto options = at::CPU(type).options();
|
||||
if (use_storage_device_) {
|
||||
options = options.device(storage.device());
|
||||
device = storage.device();
|
||||
|
Reference in New Issue
Block a user