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

[Numpy] Add NumPy support for np.linalg.det and np.linalg.slogdet #16800

Merged
merged 16 commits into from
Nov 24, 2019
Prev Previous commit
Next Next commit
size_t
  • Loading branch information
Ubuntu committed Nov 22, 2019
commit f8202003c482d058f85b5729752bf938c57e3f40
4 changes: 2 additions & 2 deletions src/operator/tensor/la_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -909,14 +909,14 @@ void LaOpDetBackward(const nnvm::NodeAttrs& attrs,
CHECK_EQ(outputs.size(), 1);
MSHADOW_SGL_DBL_TYPE_SWITCH(outputs[0].type_flag_, OType, {
std::vector<TBlob> tspace(outputs);
for ( int i = 0; i < outputs.size(); ++i ) {
for ( size_t i = 0; i < outputs.size(); ++i ) {
if ( req[i] == kAddTo ) {
tspace[i].dptr_ = ctx.requested[0]
.get_space_typed<xpu, 1, OType>(Shape1(outputs[i].Size()), s).dptr_;
}
}
LaOpDetBackwardCaller<xpu, OType, onum, laop>::op(inputs, tspace, attrs, ctx);
for ( int i = 0; i < outputs.size(); ++i ) {
for ( size_t i = 0; i < outputs.size(); ++i ) {
if ( req[i] == kAddTo ) {
Tensor<xpu, 1, OType> out = outputs[i].FlatTo1D<xpu, OType>(s);
out += tspace[i].FlatTo1D<xpu, OType>(s);
Expand Down