This method is for the base class MklConvOp, which handles the floating point implementation of Conv. The quantized conv implementations will use overridden versions of this method.
| 829 | // floating point implementation of Conv. The quantized conv implementations |
| 830 | // will use overridden versions of this method. |
| 831 | virtual void ExtendConvFwdParams(OpKernelContext* context, |
| 832 | MklConvFwdParams& params) { |
| 833 | // Create a string from data types of input, filter, bias, and output. |
| 834 | params.dtypes.append(typeid(Tinput).name()); |
| 835 | params.dtypes.append(typeid(Tfilter).name()); |
| 836 | params.dtypes.append(typeid(Tbias).name()); |
| 837 | params.dtypes.append(typeid(Toutput).name()); |
| 838 | |
| 839 | // Add fusions as post ops |
| 840 | // NOTE: Fusion of BiasAdd is handled directly inside MklConvOp by |
| 841 | // checking `fuse_biasadd_` flag. |
| 842 | if (fuse_add_) { |
| 843 | params.post_op_params.push_back({"sum", ALGORITHM_UNDEF, {1.0}, ""}); |
| 844 | } |
| 845 | if (fuse_activation_) { |
| 846 | params.post_op_params.push_back( |
| 847 | {"activation", activation_alg_, {1.0, alpha_or_upbound_, 0.0}, ""}); |
| 848 | } |
| 849 | } |
| 850 | |
| 851 | virtual Tbias* GetBiasHandle(OpKernelContext* context, |
| 852 | std::shared_ptr<ConvFwdPd>& conv2d_fwd_pd, |