fix shape type error

pull/10189/head
liubuyu 4 years ago
parent 3111529d5c
commit 4d75d7b992

@ -22,6 +22,7 @@
#include <algorithm>
#include <map>
#include <climits>
#include "utils/utils.h"
#include "runtime/device/kernel_runtime.h"
#include "backend/kernel_compiler/aicpu/aicpu_kernel_mod.h"
#include "proto/tensor.pb.h"
@ -402,7 +403,8 @@ bool CreateExtInfo(const std::shared_ptr<AnfNode> &anf_node, const std::shared_p
char *ext_info_buf = ext_info.data();
UnknowShapeOpType shape_type = UnknowShapeOpType::DEPEND_IN_SHAPE;
if (AnfAlgo::GetCNodeName(anf_node) == "Unique") {
auto op_name = AnfAlgo::GetCNodeName(anf_node);
if (kComputeDepend.find(op_name) != kComputeDepend.end()) {
shape_type = UnknowShapeOpType::DEPEND_COMPUTE;
}
ext_info_offset = SetExtInfoShapeType(ext_info_buf, ext_info_offset, shape_type);

@ -21,6 +21,7 @@
#include <algorithm>
#include "runtime/mem.h"
#include "runtime/kernel.h"
#include "utils/utils.h"
#include "backend/session/anf_runtime_algorithm.h"
#include "backend/kernel_compiler/aicpu/aicpu_util.h"
#include "runtime/device/executor/executor_callback.h"
@ -28,7 +29,6 @@
namespace mindspore {
namespace device {
namespace ascend {
std::set<std::string> kComputeDepend = {"Unique", "ComputeAccidentalHits"};
AiCpuDynamicKernel::~AiCpuDynamicKernel() {
// free dev ptr
if (ext_info_addr_dev_ == nullptr) {

@ -92,6 +92,7 @@ bool AicpuExtInfoHandler::ParseExtShapeType(AicpuExtInfo *aicpu_ext_info) {
if (*type != unknown_type_) {
MS_LOG(ERROR) << "Node:" << node_name_ << " parse ext shape type failed as need:" << unknown_type_
<< " but got:" << *type;
return false;
}
MS_LOG(INFO) << "Node:" << node_name_ << "parse ext shape type success infoLen=" << aicpu_ext_info->infoLen;
return true;

@ -30,6 +30,8 @@
namespace mindspore {
// op name. Op which not exists in operator/ops.h, so define it's name here
constexpr auto kUniqueOpName = "Unique";
constexpr auto kComputeAccidentalHitsOpName = "ComputeAccidentalHits";
constexpr auto kFour2FiveOpName = "Four2Five";
constexpr auto kFive2FourOpName = "Five2Four";
constexpr auto kConv2DOpName = "Conv2D";
@ -478,6 +480,8 @@ const std::set<std::string> kHWSpecialFormatSet = {
const std::set<TypeId> kFloatDataTypeSet = {kNumberTypeFloat16, kNumberTypeFloat32};
const std::set<std::string> kComputeDepend = {kUniqueOpName, kComputeAccidentalHitsOpName};
static inline void ChangeFileMode(const std::string &file_name, mode_t mode) {
try {
if (chmod(file_name.c_str(), mode) != 0) {

Loading…
Cancel
Save