diff options
author | Guozhong Zhuang <guozhong.zhuang@intel.com> | 2018-08-29 16:34:28 -0700 |
---|---|---|
committer | Guozhong Zhuang <guozhong.zhuang@intel.com> | 2018-08-29 16:34:28 -0700 |
commit | 420bac9053f59c3650ce7cbc9291d90feca5c47b (patch) | |
tree | 249b177e47af6aaa25c41d2db9d7bd5cdbbbb194 /tensorflow/core/kernels/mkl_conv_grad_input_ops.cc | |
parent | 42c98808dcde929516e15924639115bed4ee6a67 (diff) |
per review suggestions, replace a private member with a local one (multiple files)
Diffstat (limited to 'tensorflow/core/kernels/mkl_conv_grad_input_ops.cc')
-rw-r--r-- | tensorflow/core/kernels/mkl_conv_grad_input_ops.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tensorflow/core/kernels/mkl_conv_grad_input_ops.cc b/tensorflow/core/kernels/mkl_conv_grad_input_ops.cc index 33f114f988..c38c9cc27c 100644 --- a/tensorflow/core/kernels/mkl_conv_grad_input_ops.cc +++ b/tensorflow/core/kernels/mkl_conv_grad_input_ops.cc @@ -718,11 +718,11 @@ class MklConvCustomBackpropInputOp : public MklConvBackpropCommonOp<Device, T> { // in the following cases // 1. Legacy CPU without AVX512/AVX2, or // 2. 1x1 convolution with stride != 1 - do_not_cache_ = MklPrimitiveFactory<T>::IsPrimitiveMemOptEnabled() && + bool do_not_cache = MklPrimitiveFactory<T>::IsPrimitiveMemOptEnabled() && (MklPrimitiveFactory<T>::IsLegacyPlatform() || IsConv1x1StrideNot1(fwd_filter_dims, strides)); conv_bwd_input = MklConvBwdInputPrimitiveFactory<T>::Get(convBwdInputDims, - do_not_cache_); + do_not_cache); auto bwd_input_pd = conv_bwd_input->GetPrimitiveDesc(); // allocate output tensor @@ -770,7 +770,7 @@ class MklConvCustomBackpropInputOp : public MklConvBackpropCommonOp<Device, T> { conv_bwd_input->Execute(diff_src_data, filter_data, diff_dst_data); // delete primitive since it is not cached. - if (do_not_cache_) { + if (do_not_cache) { delete conv_bwd_input; } } catch (mkldnn::error& e) { @@ -787,7 +787,6 @@ class MklConvCustomBackpropInputOp : public MklConvBackpropCommonOp<Device, T> { const int kInputIndex_Filter = 1, kInputIndex_InputSizes = 0; const int kDilationH = 0, kDilationW = 1; engine cpu_engine = engine(engine::cpu, 0); - bool do_not_cache_; // Validate input shapes. // Function asserts that input shapes are valid. |