提交 7872d06f 编写于 作者: B bingyanghuang 提交者: Tao Luo

Add explanation on conv grad for dims<3 (#22125)

上级 724b13e4
...@@ -74,7 +74,9 @@ tf_pd<Type> MKLDNNBwdPrimitiveDesc(const Engine& e, const Primitive& p, ...@@ -74,7 +74,9 @@ tf_pd<Type> MKLDNNBwdPrimitiveDesc(const Engine& e, const Primitive& p,
inline void MatchShapeToLayout(framework::Tensor* tensor_in, inline void MatchShapeToLayout(framework::Tensor* tensor_in,
framework::DataLayout from, framework::DataLayout from,
framework::DataLayout to) { framework::DataLayout to) {
// Shape changing makes sense for 3+ dims Tensors // In these data layouts, channel dimension is either on 2nd position: nChw or
// at last nhwC, so for dim==2 these layouts are the same and nothing should
// be done. Similarly for dim==1 when you have just one possible combination.
if (tensor_in->dims().size() < 3) { if (tensor_in->dims().size() < 3) {
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册