Browse Source

!8786 [lite] adjust mindir update

From: @xu_anyue
Reviewed-by: @hangangqiang,@zhanghaibo5
Signed-off-by: @hangangqiang
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
5671a7c4da
6 changed files with 13 additions and 13 deletions
  1. +2
    -2
      mindspore/lite/src/ops/conv2d_grad_filter.cc
  2. +2
    -2
      mindspore/lite/src/ops/conv2d_grad_input.cc
  3. +2
    -2
      mindspore/lite/src/ops/reduce.cc
  4. +4
    -4
      mindspore/lite/src/ops/slice.cc
  5. +2
    -2
      mindspore/lite/src/ops/tile.cc
  6. +1
    -1
      mindspore/lite/tools/anf_exporter/anf_exporter.cc

+ 2
- 2
mindspore/lite/src/ops/conv2d_grad_filter.cc View File

@@ -152,9 +152,9 @@ int Conv2DGradFilter::UnPackAttr(const Primitive &prim, const std::vector<AnfNod
const int nchw2nhwc[] = {0, 3, 1, 2};
attr->filter_shape.resize(valTuplPtr->size());
for (size_t i = 0; i < valTuplPtr->size(); i++) {
auto elem = dyn_cast<Int32Imm>((*valTuplPtr)[i]);
auto elem = (*valTuplPtr)[i];
MS_ASSERT(elem != nullptr);
attr->filter_shape[nchw2nhwc[i]] = elem->value();
attr->filter_shape[nchw2nhwc[i]] = CastToInt(elem, false).front();
}
}
}


+ 2
- 2
mindspore/lite/src/ops/conv2d_grad_input.cc View File

@@ -154,9 +154,9 @@ int Conv2DGradInput::UnPackAttr(const Primitive &prim, const std::vector<AnfNode
const int nchw2nhwc[] = {0, 3, 1, 2};
attr->input_shape.resize(valTuplPtr->size());
for (size_t i = 0; i < valTuplPtr->size(); i++) {
auto elem = dyn_cast<Int32Imm>((*valTuplPtr)[i]);
auto elem = (*valTuplPtr)[i];
MS_ASSERT(elem != nullptr);
attr->input_shape[nchw2nhwc[i]] = elem->value();
attr->input_shape[nchw2nhwc[i]] = CastToInt(elem, false).front();
}
}
}


+ 2
- 2
mindspore/lite/src/ops/reduce.cc View File

@@ -82,9 +82,9 @@ int Reduce::UnPackAttr(const Primitive &prim, const std::vector<AnfNodePtr> &inp
auto valTuplPtr = dyn_cast<ValueTuple>(value);
MS_ASSERT(valTuplPtr != nullptr);
for (size_t i = 0; i < valTuplPtr->size(); i++) {
auto elem = dyn_cast<Int32Imm>((*valTuplPtr)[i]);
auto elem = (*valTuplPtr)[i];
MS_ASSERT(elem != nullptr);
attr->axes.emplace_back(elem->value());
attr->axes.emplace_back(CastToInt(elem, false).front());
}
} else {
int axes_item = CastToInt(value, false).front();


+ 4
- 4
mindspore/lite/src/ops/slice.cc View File

@@ -71,9 +71,9 @@ int Slice::UnPackAttr(const Primitive &prim, const std::vector<AnfNodePtr> &inpu
auto valTuplPtr = dyn_cast<ValueTuple>(value);
MS_ASSERT(valTuplPtr != nullptr);
for (size_t i = 0; i < valTuplPtr->size(); i++) {
auto elem = dyn_cast<Int32Imm>((*valTuplPtr)[i]);
auto elem = (*valTuplPtr)[i];
MS_ASSERT(elem != nullptr);
attr->begin.emplace_back(elem->value());
attr->begin.emplace_back(CastToInt(elem, false).front());
}
}
}
@@ -88,9 +88,9 @@ int Slice::UnPackAttr(const Primitive &prim, const std::vector<AnfNodePtr> &inpu
auto valTuplPtr = dyn_cast<ValueTuple>(value);
MS_ASSERT(valTuplPtr != nullptr);
for (size_t i = 0; i < valTuplPtr->size(); i++) {
auto elem = dyn_cast<Int32Imm>((*valTuplPtr)[i]);
auto elem = (*valTuplPtr)[i];
MS_ASSERT(elem != nullptr);
attr->size.emplace_back(elem->value());
attr->size.emplace_back(CastToInt(elem, false).front());
}
}
}


+ 2
- 2
mindspore/lite/src/ops/tile.cc View File

@@ -70,9 +70,9 @@ int Tile::UnPackAttr(const Primitive &prim, const std::vector<AnfNodePtr> &input
auto valTuplPtr = dyn_cast<ValueTuple>(value);
MS_ASSERT(valTuplPtr != nullptr);
for (size_t i = 0; i < valTuplPtr->size(); i++) {
auto elem = dyn_cast<Int32Imm>((*valTuplPtr)[i]);
auto elem = (*valTuplPtr)[i];
MS_ASSERT(elem != nullptr);
attr->multiples.emplace_back(elem->value());
attr->multiples.emplace_back(CastToInt(elem, false).front());
}
} else {
int multiple = CastToInt(value, false).front();


+ 1
- 1
mindspore/lite/tools/anf_exporter/anf_exporter.cc View File

@@ -408,7 +408,7 @@ int AnfExporter::ConvertInputValueNode(std::shared_ptr<AnfNode> input_anode,
node_id_map_[valueNode->fullname_with_scope()] = meta_graphT->allTensors.size();
output_cnode->inputIndex.emplace_back(meta_graphT->allTensors.size());
meta_graphT->allTensors.emplace_back(std::move(paramTensor));
} else if (value->isa<mindspore::Int32Imm>()) {
} else if (value->isa<mindspore::Int32Imm>() || value->isa<mindspore::Int64Imm>()) {
auto valueAbstract = valueNode->abstract();
auto abstractScalar = utils::cast<abstract::AbstractScalarPtr>(valueAbstract);
auto typePtr = abstractScalar->GetTypeTrack();


Loading…
Cancel
Save