You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2022/03/16 12:23:53 UTC

[GitHub] [incubator-mxnet] bartekkuncer commented on a change in pull request #20962: [operator] Integrate oneDNN eltwise primitive to mxnet _npi_multiply_…

bartekkuncer commented on a change in pull request #20962:
URL: https://github.com/apache/incubator-mxnet/pull/20962#discussion_r827947996



##########
File path: src/operator/nn/dnnl/dnnl_multiply_scalar-inl.h
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*!
+ * \file dnnl_multiply_scalar-inl.h
+ */
+
+#ifndef MXNET_OPERATOR_NN_DNNL_DNNL_MULTIPLY_SCALAR_INL_H_
+#define MXNET_OPERATOR_NN_DNNL_DNNL_MULTIPLY_SCALAR_INL_H_
+
+#if MXNET_USE_ONEDNN == 1
+
+#include "operator/numpy/np_elemwise_broadcast_op.h"
+
+namespace mxnet {
+namespace op {
+
+using eltwise_fwd_t    = dnnl::eltwise_forward;
+using eltwise_fwd_pd_t = dnnl::eltwise_forward::primitive_desc;
+
+class DNNLMultiplyScalarFwd {
+ public:
+  static DNNLMultiplyScalarFwd& GetMultiplyScalarForward(const nnvm::NodeAttrs& attrs,
+                                                         const NDArray& input,
+                                                         const NDArray& outputs);
+
+  DNNLMultiplyScalarFwd(const NDArray& input, const float multiplier);
+
+  void Execute(const NDArray& input, const OpReqType& req, const NDArray& output);
+
+ private:
+  std::shared_ptr<eltwise_fwd_t> fwd;
+  std::shared_ptr<eltwise_fwd_pd_t> fwd_pd;
+};
+
+typedef OpSignature DNNLMultiplyScalarSignature;
+
+void DNNLMultiplyScalarForward(const nnvm::NodeAttrs& attrs,

Review comment:
       To be deleted.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org