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:
PyTorch MergeBot
2024-11-06 13:23:43 +00:00
parent 5f266b5a02
commit 53299b8a38
4 changed files with 14 additions and 14 deletions

View File

@ -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();