Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Fix dtype inference in arange_like operator #15930

Merged
merged 4 commits into from
Aug 25, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/operator/tensor/init_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Examples::
.set_num_outputs(1)
.set_attr_parser(ParamParser<RangeLikeParam>)
.set_attr<mxnet::FInferShape>("FInferShape", RangeLikeShape)
.set_attr<nnvm::FInferType>("FInferType", InitType<RangeLikeParam, 1>)
.set_attr<nnvm::FInferType>("FInferType", ElemwiseType<1, 1>)
.set_attr<nnvm::FIgnoreInputs>("FIgnoreInputs",
[](const NodeAttrs& attrs) { return std::vector<uint32_t>(1, 0); })
.set_attr<FCompute>("FCompute<cpu>", RangeCompute<cpu, RangeLikeParam>)
Expand Down
4 changes: 0 additions & 4 deletions src/operator/tensor/init_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ struct RangeLikeParam : public dmlc::Parameter<RangeLikeParam> {
double step;
int repeat;
std::string ctx;
int dtype;
dmlc::optional<int> axis;

DMLC_DECLARE_PARAMETER(RangeLikeParam) {
Expand All @@ -197,9 +196,6 @@ struct RangeLikeParam : public dmlc::Parameter<RangeLikeParam> {
.set_default("")
.describe("Context of output, in format [cpu|gpu|cpu_pinned](n)."
"Only used for imperative calls.");
DMLC_DECLARE_FIELD(dtype).set_default(mshadow::kFloat32)
MXNET_ADD_ALL_TYPES
.describe("Target data type.");
DMLC_DECLARE_FIELD(axis)
.set_default(dmlc::optional<int>())
.describe("Arange elements according to the size of a certain axis of input array."
Expand Down