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

Commit

Permalink
fixed whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Skalicky committed Aug 21, 2018
1 parent c76f60d commit 0f00c2a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/operator/tensor/elemwise_binary_scalar_op_extended.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,30 +105,31 @@ Example::
.set_num_inputs(1)
.set_num_outputs(1)
.set_attr_parser([](NodeAttrs* attrs) {
if(attrs->dict.find("scalar") != attrs->dict.end())
if (attrs->dict.find("scalar") != attrs->dict.end())
attrs->parsed = std::stod(attrs->dict["scalar"]);
else
attrs->parsed = 1.0;
})
.set_attr<nnvm::FInferShape>("FInferShape", ElemwiseShape<1, 1>)
.set_attr<nnvm::FInferType>("FInferType", ElemwiseType<1, 1>)
.set_attr<nnvm::FInplaceOption>("FInplaceOption",
[](const NodeAttrs& attrs){
return std::vector<std::pair<int, int> >{{0, 0}};
})
[](const NodeAttrs& attrs){
return std::vector<std::pair<int, int> >{{0, 0}};
})
.add_argument("data", "NDArray-or-Symbol", "source input")
.add_argument("scalar", "float", "scalar input")
.set_attr<FCompute>("FCompute<cpu>", BinaryScalarOp::Compute<cpu, mshadow_op::smooth_l1_loss>)
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{ "_backward_smooth_l1" });

MXNET_OPERATOR_REGISTER_BINARY(_backward_smooth_l1)
.set_attr_parser([](NodeAttrs *attrs) {
if(attrs->dict.find("scalar") != attrs->dict.end())
if (attrs->dict.find("scalar") != attrs->dict.end())
attrs->parsed = std::stod(attrs->dict["scalar"]);
else
attrs->parsed = 1.0;
})
.set_attr<FCompute>("FCompute<cpu>", BinaryScalarOp::Backward<cpu, mshadow_op::smooth_l1_gradient>);

.set_attr<FCompute>("FCompute<cpu>",
BinaryScalarOp::Backward<cpu, mshadow_op::smooth_l1_gradient>);

} // namespace op
} // namespace mxnet

0 comments on commit 0f00c2a

Please sign in to comment.