haojin2 commented on a change in pull request #18049: [numpy] add numpy op fill_diagonal URL: https://github.com/apache/incubator-mxnet/pull/18049#discussion_r409961176
########## File path: src/operator/numpy/np_fill_diagonal_op-inl.h ########## @@ -0,0 +1,174 @@ +/* + * 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) 2020 by Contributors + * \file np_tril_op-inl.h + * \brief Function definition of the tril (lower triangle of an array) op + */ + +#ifndef MXNET_OPERATOR_NUMPY_NP_FILL_DIAGONAL_OP_INL_H_ +#define MXNET_OPERATOR_NUMPY_NP_FILL_DIAGONAL_OP_INL_H_ + +#include <dmlc/parameter.h> +#include <vector> +#include <string> +#include <algorithm> +#include "../mxnet_op.h" +#include "../operator_common.h" +#include "../elemwise_op_common.h" + +namespace mxnet { +namespace op { + +struct NumpyFillDiagonalParam : public dmlc::Parameter<NumpyFillDiagonalParam> { + Tuple<double> val; + bool wrap; + DMLC_DECLARE_PARAMETER(NumpyFillDiagonalParam) { + DMLC_DECLARE_FIELD(val) + .describe("Value to be written on the diagonal, " + "its type must be compatible with that of the array a."); + DMLC_DECLARE_FIELD(wrap) + .set_default(false) + .describe("The diagonal “wrapped” after N columns." + "You can have this behavior with this option. " + "This affects only tall matrices."); + } + void SetAttrDict(std::unordered_map<std::string, std::string>* dict) { Review comment: one more blank line above ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
