sync-from-trunk-to-blue-zone-0928

pull/187/head
wuweikang 4 years ago committed by taoxiangdong
parent 9a60c29bd7
commit a2ec076850

@ -402,7 +402,6 @@ LOCAL_C_INCLUDES := $(RUNNER_LOCAL_C_INCLUDES)
LOCAL_SRC_FILES := ../../out/ge/lib64/stub/ge_api.cc \
../../out/ge/lib64/stub/ge_prof.cc \
LOCAL_SHARED_LIBRARIES :=
LOCAL_LDFLAGS := -lrt -ldl

@ -825,6 +825,7 @@ Status AippOp::AddAttrToAippData(const OpDescPtr &aipp_data_op_desc) {
}
Status AippOp::AddNodeToGraph(const NodePtr &aipp_node, int64_t max_dynamic_aipp_size) {
static int index = 0;
std::vector<int64_t> input_shape_dim(1, max_dynamic_aipp_size);
GeShape input_shape(input_shape_dim);
// construct input tensor

@ -40,6 +40,7 @@
#include "inc/pass_manager.h"
#include "graph/common/local_context.h"
using std::map;
using std::set;
using std::string;
using std::vector;
@ -263,27 +264,24 @@ Status MultiBatchGraphCopyer::Init() {
}
Status MultiBatchGraphCopyer::LabelStatus() {
for (const auto &data : origin_data_nodes_) {
auto data_shape = NodeUtils::GetOutputDesc(*data, kDataOutIndex).GetShape();
if (!IsAllDimsPositive(data_shape.GetDims())) {
origin_nodes_status_[data.get()] = kNodeInBatchBranch;
}
}
map<string, vector<NodePtr>> frame_enters;
InitStatus(frame_enters);
bool changed = true;
// If anyone of in node is kNodeInBatchBranch, it is also kNodeInBatchBranch
while (changed) {
changed = false;
for (const auto &node : origin_all_nodes_) {
auto iter = origin_nodes_status_.find(node.get());
if (iter != origin_nodes_status_.end()) {
continue;
}
for (auto &in_node : node->GetInAllNodes()) {
bool is_in_batch = origin_nodes_status_.find(in_node.get()) != origin_nodes_status_.end() &&
origin_nodes_status_[in_node.get()] == kNodeInBatchBranch;
if (is_in_batch) {
origin_nodes_status_[node.get()] = kNodeInBatchBranch;
changed = true;
if (origin_nodes_status_.find(node.get()) == origin_nodes_status_.end() ||
origin_nodes_status_[node.get()] != kNodeInBatchBranch) {
origin_nodes_status_[node.get()] = kNodeInBatchBranch;
ResetEnterStatus(frame_enters, node);
changed = true;
}
break;
}
}

@ -69,6 +69,8 @@ class MultiBatchGraphCopyer {
// label status for origin_all_nodes_
Status LabelStatus();
void InitStatus(std::map<string, vector<NodePtr>> &frame_enters);
void ResetEnterStatus(std::map<string, vector<NodePtr>> &frame_enters, const NodePtr &node);
// add nodes functions
Status CreateNewNodes();

File diff suppressed because it is too large Load Diff

@ -1,18 +1,18 @@
/**
* Copyright 2019-2020 Huawei Technologies Co., Ltd
*
* Licensed 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 2019-2020 Huawei Technologies Co., Ltd
*
* Licensed 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.
*/
#ifndef INC_FRAMEWORK_COMMON_GE_TYPES_H_
#define INC_FRAMEWORK_COMMON_GE_TYPES_H_
@ -29,30 +29,30 @@
namespace ge {
enum RuntimeType {
HOST = 0,
DEVICE = 1
HOST = 0,
DEVICE = 1
};
enum PerfLevel {
GEN_TASK_WITH_FUSION = -1,
GEN_TASK_WITHOUT_L2FUSION = 3,
GEN_TASK_WITHOUT_FUSION = 4
GEN_TASK_WITH_FUSION = -1,
GEN_TASK_WITHOUT_L2FUSION = 3,
GEN_TASK_WITHOUT_FUSION = 4
};
enum FrameworkType {
CAFFE = 0,
MINDSPORE = 1,
TENSORFLOW = 3,
ANDROID_NN,
FRAMEWORK_RESERVED,
CAFFE = 0,
MINDSPORE = 1,
TENSORFLOW = 3,
ANDROID_NN,
FRAMEWORK_RESERVED,
};
enum OpEngineType {
ENGINE_SYS = 0, // default engine
ENGINE_AICORE = 1,
ENGINE_VECTOR = 2,
ENGINE_AICUBE = 3, // not support
ENGINE_AIVECTOR = 4 // not support
ENGINE_SYS = 0, // default engine
ENGINE_AICORE = 1,
ENGINE_VECTOR = 2,
ENGINE_AICUBE = 3, // not support
ENGINE_AIVECTOR = 4 // not support
};
enum InputAippType{

@ -725,14 +725,14 @@ REG_OP(Conv2D)
| | int8 | int8 | int32 | int8 | int32
-----------|---------|---------|---------|----------|--------
|Format | NCHW | NCHW | ND | ND | NCHW
| | NHWC | NHWC | | | NHWC
| | | HWCN | | |
| | NHWC | HWCN | | | NHWC
@endverbatim
* It should be noted that the data types must correspond to each other, but the
* format does not need to . \n
* Type float32 is allowed only in mixed precision (float32->float16) scenarios.
* Mixed precision is enabled by default.
* \n
*
*@par Attributes:
* @li strides: A list of 4 integers. Specifying the strides of the
*@li strides: Required. A list of 4 integers. Specifying the strides of the
* convolution along the height and width. The dimension order is determined
* by the data format of "x". By default the N and C dimensions are set to 1.
* @li pads: A list of 4 integers. Specifying the top, bottom, left and right
@ -865,8 +865,8 @@ REG_OP(Conv2DCompress)
* "HxW(filter)" indicates the filter size after dilation.
*@par Quantization supported or not
* Yes
*@li Yes
*
*@par Third-party framework compatibility
*@li Compatible with the TensorFlow operator "conv2d".
*@li Compatible with the Caffe operator 2D "Convolution".

Loading…
Cancel
Save