Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion aten/src/ATen/native/mkldnn/Linear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ Tensor mkldnn_linear(
"mkldnn_linear: input needs to has dim at least 2, input dim ", self.dim());
TORCH_CHECK(self.is_mkldnn(),
"mkldnn_linear: input needs to be mkldnn layout");
TORCH_CHECK(weight.is_mkldnn() && bias.is_mkldnn(),
TORCH_CHECK(
weight.is_mkldnn() && (!bias.defined() || bias.is_mkldnn()),
"mkldnn_linear: weight and bias need to be mkldnn layout");

// reshape first if input dim is greater than 2 and the reshape will cost a memory copy.
Expand Down