diff --git a/src/ATen/native/xpu/SummaryOps.cpp b/src/ATen/native/xpu/SummaryOps.cpp index 0f5cbe43506..98f0d8c42ad 100644 --- a/src/ATen/native/xpu/SummaryOps.cpp +++ b/src/ATen/native/xpu/SummaryOps.cpp @@ -55,6 +55,13 @@ Tensor& _histc_out_xpu( const Scalar& min, const Scalar& max, Tensor& result) { + TORCH_CHECK( + self.dtype() == result.dtype(), + "torch.histogram: input tensor and hist tensor should", + " have the same dtype, but got input ", + self.dtype(), + " and hist ", + result.dtype()); auto ret = _histc_xpu(self, bins, min, max); at::native::resize_output(result, ret.sizes()); result.copy_(ret); diff --git a/test/xpu/skip_list_common.py b/test/xpu/skip_list_common.py index 33245852f24..8a631a1950c 100644 --- a/test/xpu/skip_list_common.py +++ b/test/xpu/skip_list_common.py @@ -183,7 +183,6 @@ # Exception: The supported dtypes for linalg.multi_dot on device type xpu are incorrect! "test_dtypes_linalg_multi_dot_xpu", # For CUDA it's skipped explicitly in common_methods_invocations.py in upstream. We can skip it here - "test_out_histc_xpu_float32", "test_out_mean_xpu_float32", # FakeTensor mismatch in outputs_alias_inputs for aten.view.default # Known upstream issue: https://github.com/pytorch/pytorch/issues/159150 diff --git a/test/xpu/xpu_test_utils.py b/test/xpu/xpu_test_utils.py index 50929bf4c38..d66b817ad13 100644 --- a/test/xpu/xpu_test_utils.py +++ b/test/xpu/xpu_test_utils.py @@ -349,7 +349,6 @@ ("_batch_norm_with_update", "test_dispatch_symbolic_meta_outplace_all_strides"), ("_native_batch_norm_legit", "test_out"), ("native_batch_norm", "test_out"), - ("histc", "test_out"), ("_refs.mul", "test_python_ref"), ("_refs.mul", "test_python_ref_torch_fallback"), ("nn.AvgPool2d", "test_memory_format"),