From a4260f834b0d4d1f6ee3ba14af7d1c9a0487e98f Mon Sep 17 00:00:00 2001 From: ckt624 Date: Mon, 12 Aug 2019 14:39:57 +0800 Subject: [PATCH] Remove np_matrix_op.h --- src/operator/numpy/np_matrix_op-inl.h | 65 ------------------------ src/operator/numpy/np_tensordot_op-inl.h | 2 +- 2 files changed, 1 insertion(+), 66 deletions(-) delete mode 100644 src/operator/numpy/np_matrix_op-inl.h diff --git a/src/operator/numpy/np_matrix_op-inl.h b/src/operator/numpy/np_matrix_op-inl.h deleted file mode 100644 index 44a6c909c9cf..000000000000 --- a/src/operator/numpy/np_matrix_op-inl.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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. - */ - -/*! - * Copyright (c) 2019 by Contributors - * \file np_matrix_op-inl.h - * \brief Function definition of matrix related operators - */ -#ifndef MXNET_OPERATOR_NUMPY_NP_MATRIX_OP_INL_H_ -#define MXNET_OPERATOR_NUMPY_NP_MATRIX_OP_INL_H_ - -#include -#include "../tensor/matrix_op-inl.h" - -namespace mxnet { -namespace op { - -struct NumpyTransposeParam : public dmlc::Parameter { - mxnet::TShape axes; - DMLC_DECLARE_PARAMETER(NumpyTransposeParam) { - DMLC_DECLARE_FIELD(axes).set_default(mxnet::TShape(-1, 0)) - .describe("By default, reverse the dimensions, otherwise permute " - "the axes according to the values given."); - } -}; - -template -void NumpyTranspose(const nnvm::NodeAttrs& attrs, - const OpContext& ctx, - const std::vector& inputs, - const std::vector& req, - const std::vector& outputs) { - const NumpyTransposeParam& param = nnvm::get(attrs.parsed); - CHECK_EQ(req[0], kWriteTo) << "Transpose does not support inplace"; - if (ndim_is_known(param.axes)) { - TransposeImpl(ctx.run_ctx, inputs[0], outputs[0], param.axes); - } else { - mxnet::TShape axes(inputs[0].ndim(), -1); - for (int i = 0; i < axes.ndim(); ++i) { - axes[i] = axes.ndim() - 1 - i; - } - TransposeImpl(ctx.run_ctx, inputs[0], outputs[0], axes); - } -} - -} // namespace op -} // namespace mxnet - -#endif // MXNET_OPERATOR_NUMPY_NP_MATRIX_OP_INL_H_ diff --git a/src/operator/numpy/np_tensordot_op-inl.h b/src/operator/numpy/np_tensordot_op-inl.h index d985e8e2f4b2..da3891665c4b 100644 --- a/src/operator/numpy/np_tensordot_op-inl.h +++ b/src/operator/numpy/np_tensordot_op-inl.h @@ -25,7 +25,7 @@ #define MXNET_OPERATOR_NUMPY_NP_TENSORDOT_OP_INL_H_ #include -#include "np_matrix_op-inl.h" +#include "../tensor/matrix_op-inl.h" namespace mxnet { namespace op {