Skip to content

Commit 51c8b48

Browse files
committed
Refine the logic to check if a tensor contains data or not in case the buffer of input tensor is dnnl
1 parent 9f7093c commit 51c8b48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch_ipex/csrc/cpu/dbl/DNNLChecker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ bool dnnl_support_the_dimension_of(const std::vector<at::Tensor> &tensor_vec) {
5656

5757
bool dnnl_tensor_has_data(const std::vector<at::Tensor> &tensor_vec) {
5858
for (auto it = tensor_vec.begin(); it != tensor_vec.end(); ++it)
59-
if (it->data_ptr() == nullptr)
59+
if (it->numel() == 0)
6060
return false;
6161

6262
return true;

0 commit comments

Comments
 (0)