| @@ -32,9 +32,9 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ConstantOperator &ConstantOpera | |||||
| } | } | ||||
| FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ConstantOperator &ConstantOperator::DType(ge::DataType t) { | FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ConstantOperator &ConstantOperator::DType(ge::DataType t) { | ||||
| Attr(VAR_ATTR_DTYPE, (int64_t)t); | |||||
| Attr(VAR_ATTR_DTYPE, static_cast<int64_t>(t)); | |||||
| return *this; | return *this; | ||||
| } | } | ||||
| ge::DataType ConstantOperator::GetDType() const { return (ge::DataType)GetIntAttr(VAR_ATTR_DTYPE); } | |||||
| ge::DataType ConstantOperator::GetDType() const { return static_cast<ge::DataType>(GetIntAttr(VAR_ATTR_DTYPE)); } | |||||
| } // namespace ge | } // namespace ge | ||||
| @@ -32,7 +32,7 @@ static void ConvertList(const std::pair<std::string, OpAttribute> &op_attr_pair, | |||||
| vector<int64_t> v_i; | vector<int64_t> v_i; | ||||
| for (int32_t i = 0; i < a_list.i_size(); i++) { | for (int32_t i = 0; i < a_list.i_size(); i++) { | ||||
| v_i.push_back((int64_t)a_list.i(i)); | |||||
| v_i.push_back(static_cast<int64_t>(a_list.i(i))); | |||||
| } | } | ||||
| if (v_i.size() > 0) { | if (v_i.size() > 0) { | ||||
| (void)ge::AttrUtils::SetListInt(op_def, op_attr_pair.first, v_i); | (void)ge::AttrUtils::SetListInt(op_def, op_attr_pair.first, v_i); | ||||
| @@ -56,7 +56,7 @@ static void ConvertList(const std::pair<std::string, OpAttribute> &op_attr_pair, | |||||
| } | } | ||||
| vector<int32_t> v_u; | vector<int32_t> v_u; | ||||
| for (int32_t i = 0; i < a_list.u_size(); i++) { | for (int32_t i = 0; i < a_list.u_size(); i++) { | ||||
| v_u.push_back((int32_t)a_list.u(i)); | |||||
| v_u.push_back(static_cast<int32_t>(a_list.u(i))); | |||||
| } | } | ||||
| if (v_u.size() > 0) { | if (v_u.size() > 0) { | ||||
| (void)ge::AttrUtils::SetListInt(op_def, op_attr_pair.first, v_u); | (void)ge::AttrUtils::SetListInt(op_def, op_attr_pair.first, v_u); | ||||
| @@ -23,7 +23,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY RefSwitchOperator::RefSwitchOpe | |||||
| FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY RefSwitchOperator::~RefSwitchOperator() {} | FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY RefSwitchOperator::~RefSwitchOperator() {} | ||||
| FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY RefSwitchOperator &RefSwitchOperator::T(ge::DataType t) { | FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY RefSwitchOperator &RefSwitchOperator::T(ge::DataType t) { | ||||
| Attr("T", (int64_t)t); | |||||
| Attr("T", static_cast<int64_t>(t)); | |||||
| return *this; | return *this; | ||||
| } | } | ||||
| } // namespace ge AUTO GEN PLEASE DO NOT MODIFY IT | } // namespace ge AUTO GEN PLEASE DO NOT MODIFY IT | ||||
| @@ -32,20 +32,20 @@ FMK_FUNC_HOST_VISIBILITY ShapeNOperator &ShapeNOperator::N(int64_t n) { | |||||
| FMK_FUNC_HOST_VISIBILITY int64_t ShapeNOperator::GetN() const { return GetIntAttr(SHAPEN_ATTR_N); } | FMK_FUNC_HOST_VISIBILITY int64_t ShapeNOperator::GetN() const { return GetIntAttr(SHAPEN_ATTR_N); } | ||||
| FMK_FUNC_HOST_VISIBILITY ShapeNOperator &ShapeNOperator::InType(ge::DataType t) { | FMK_FUNC_HOST_VISIBILITY ShapeNOperator &ShapeNOperator::InType(ge::DataType t) { | ||||
| Attr(SHAPEN_ATTR_IN_TYPE, (int64_t)t); | |||||
| Attr(SHAPEN_ATTR_IN_TYPE, static_cast<int64_t>(t)); | |||||
| return *this; | return *this; | ||||
| } | } | ||||
| FMK_FUNC_HOST_VISIBILITY ge::DataType ShapeNOperator::GetInType() const { | FMK_FUNC_HOST_VISIBILITY ge::DataType ShapeNOperator::GetInType() const { | ||||
| return (ge::DataType)GetIntAttr(SHAPEN_ATTR_IN_TYPE); | |||||
| return static_cast<ge::DataType>(GetIntAttr(SHAPEN_ATTR_IN_TYPE)); | |||||
| } | } | ||||
| FMK_FUNC_HOST_VISIBILITY ShapeNOperator &ShapeNOperator::OutType(ge::DataType t) { | FMK_FUNC_HOST_VISIBILITY ShapeNOperator &ShapeNOperator::OutType(ge::DataType t) { | ||||
| Attr(SHAPEN_ATTR_OUT_TYPE, (int64_t)t); | |||||
| Attr(SHAPEN_ATTR_OUT_TYPE, static_cast<int64_t>(t)); | |||||
| return *this; | return *this; | ||||
| } | } | ||||
| FMK_FUNC_HOST_VISIBILITY ge::DataType ShapeNOperator::GetOutType() const { | FMK_FUNC_HOST_VISIBILITY ge::DataType ShapeNOperator::GetOutType() const { | ||||
| return (ge::DataType)GetIntAttr(SHAPEN_ATTR_OUT_TYPE); | |||||
| return static_cast<ge::DataType>(GetIntAttr(SHAPEN_ATTR_OUT_TYPE)); | |||||
| } | } | ||||
| } // namespace ge | } // namespace ge | ||||
| @@ -320,8 +320,8 @@ domi::Status GraphToFunctionDef::RecordArg(ge::ComputeGraphPtr graph, const vect | |||||
| return FAILED; | return FAILED; | ||||
| } | } | ||||
| (void)ge::AttrUtils::SetInt(op, "T", (int32_t)dtype); | |||||
| (void)ge::AttrUtils::SetInt(op, "arg_index", (int32_t)index); | |||||
| (void)ge::AttrUtils::SetInt(op, "T", static_cast<int32_t>(dtype)); | |||||
| (void)ge::AttrUtils::SetInt(op, "arg_index", static_cast<int32_t>(index)); | |||||
| ge::NodePtr arg_node = graph->AddNode(op); | ge::NodePtr arg_node = graph->AddNode(op); | ||||
| GE_CHECK_NOTNULL(arg_node); | GE_CHECK_NOTNULL(arg_node); | ||||
| bool node_exists = false; | bool node_exists = false; | ||||
| @@ -388,7 +388,8 @@ Status ParserGraphOptimizer::RebuildOutputAnchors(vector<ge::OutDataAnchorPtr> & | |||||
| GE_CHK_BOOL_EXEC(fusion_op_desc->AddOutputDesc(src_out_desc) == ge::GRAPH_SUCCESS, return FAILED); | GE_CHK_BOOL_EXEC(fusion_op_desc->AddOutputDesc(src_out_desc) == ge::GRAPH_SUCCESS, return FAILED); | ||||
| ge::DataType data_type = src_out_desc.GetDataType(); | ge::DataType data_type = src_out_desc.GetDataType(); | ||||
| const std::map<int32_t, int32_t>::const_iterator iter = GE_TENSORFLOW_DATA_TYPE_MAP.find((int32_t)data_type); | |||||
| const std::map<int32_t, int32_t>::const_iterator iter = | |||||
| GE_TENSORFLOW_DATA_TYPE_MAP.find(static_cast<int32_t>(data_type)); | |||||
| GE_IF_BOOL_EXEC( | GE_IF_BOOL_EXEC( | ||||
| iter == GE_TENSORFLOW_DATA_TYPE_MAP.end(), | iter == GE_TENSORFLOW_DATA_TYPE_MAP.end(), | ||||
| REPORT_INNER_ERROR("E19999", "datatype:%d of output:%d in node:%s:%s is not supported", | REPORT_INNER_ERROR("E19999", "datatype:%d of output:%d in node:%s:%s is not supported", | ||||
| @@ -397,7 +398,7 @@ Status ParserGraphOptimizer::RebuildOutputAnchors(vector<ge::OutDataAnchorPtr> & | |||||
| return PARAM_INVALID); | return PARAM_INVALID); | ||||
| int32_t dtype = iter->second; | int32_t dtype = iter->second; | ||||
| output_list.push_back((int64_t)dtype); | |||||
| output_list.push_back(static_cast<int64_t>(dtype)); | |||||
| GELOGI("FUNCDEF: output_list push_back %d.", dtype); | GELOGI("FUNCDEF: output_list push_back %d.", dtype); | ||||
| } | } | ||||
| GE_IF_BOOL_EXEC(!output_list.empty(), (void)AttrUtils::SetListInt(fusion_op_desc, ge::T_OUT_DATATYPE, output_list)); | GE_IF_BOOL_EXEC(!output_list.empty(), (void)AttrUtils::SetListInt(fusion_op_desc, ge::T_OUT_DATATYPE, output_list)); | ||||
| @@ -424,7 +425,8 @@ Status ParserGraphOptimizer::RebuildInputAnchors(vector<ge::InDataAnchorPtr> &in | |||||
| return FAILED; | return FAILED; | ||||
| } | } | ||||
| ge::DataType data_type = tensorDescPtr->GetDataType(); | ge::DataType data_type = tensorDescPtr->GetDataType(); | ||||
| const std::map<int32_t, int32_t>::const_iterator iter = GE_TENSORFLOW_DATA_TYPE_MAP.find((int32_t)data_type); | |||||
| const std::map<int32_t, int32_t>::const_iterator iter = | |||||
| GE_TENSORFLOW_DATA_TYPE_MAP.find(static_cast<int32_t>(data_type)); | |||||
| GE_IF_BOOL_EXEC( | GE_IF_BOOL_EXEC( | ||||
| iter == GE_TENSORFLOW_DATA_TYPE_MAP.end(), | iter == GE_TENSORFLOW_DATA_TYPE_MAP.end(), | ||||
| REPORT_INNER_ERROR("E19999", "datatype:%d of input:%d in node:%s:%s is not supported", | REPORT_INNER_ERROR("E19999", "datatype:%d of input:%d in node:%s:%s is not supported", | ||||
| @@ -433,7 +435,7 @@ Status ParserGraphOptimizer::RebuildInputAnchors(vector<ge::InDataAnchorPtr> &in | |||||
| return PARAM_INVALID); | return PARAM_INVALID); | ||||
| int32_t dtype = iter->second; | int32_t dtype = iter->second; | ||||
| input_list.push_back((int64_t)dtype); | |||||
| input_list.push_back(static_cast<int64_t>(dtype)); | |||||
| GELOGI("FUNCDEF: input_list push_back %d.", dtype); | GELOGI("FUNCDEF: input_list push_back %d.", dtype); | ||||
| } | } | ||||
| GE_IF_BOOL_EXEC(!input_list.empty(), (void)AttrUtils::SetListInt(fusion_op_desc, ge::T_IN_DATATYPE, input_list)); | GE_IF_BOOL_EXEC(!input_list.empty(), (void)AttrUtils::SetListInt(fusion_op_desc, ge::T_IN_DATATYPE, input_list)); | ||||