mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Fix build error with MSVC (#20853)
Summary: Close #20642 Possibly broken by #19816 Pull Request resolved: https://github.com/pytorch/pytorch/pull/20853 Differential Revision: D15474620 Pulled By: jerryzh168 fbshipit-source-id: 99b52d92a93bac7cab52537f1ebdbd286d4b2cfe
This commit is contained in:
committed by
Facebook Github Bot
parent
31e2d20c5e
commit
5f83c5d834
@ -13,8 +13,8 @@ Tensor& quantized_copy_(Tensor& self, const Tensor& src) {
|
||||
"Quantized copy only works with contiguous Tensors");
|
||||
TORCH_CHECK(self.sizes().equals(src.sizes()),
|
||||
"Quantized copy only works with Tensors with the same shape");
|
||||
float* src_data = src.data<float>();
|
||||
AT_DISPATCH_QINT_TYPES(self.scalar_type(), "Copy", [&]() {
|
||||
float* src_data = src.data<float>();
|
||||
scalar_t* self_data = self.data<scalar_t>();
|
||||
for (int i = 0; i < self.numel(); ++i) {
|
||||
self_data[i] = quantize_val<scalar_t>(
|
||||
|
Reference in New Issue
Block a user