|
|
|
@@ -82,16 +82,17 @@ Status TransdataKernel::Compute(const OpDescPtr op_desc_ptr, const std::vector<C |
|
|
|
const auto &data_shape = op_desc->GetShape().GetDims(); |
|
|
|
const auto &data_format = op_desc->GetFormat(); |
|
|
|
const auto &data_type = op_desc->GetDataType(); |
|
|
|
const in64_t groups = op_desc_ptr->GetAttr("groups", groups) |
|
|
|
GELOGD( |
|
|
|
"current node %s, format %s, input shape %s, data type %s, weight format %s, shape %s, data type %s. " |
|
|
|
"output format %s, shape %s, data type %s", |
|
|
|
"output format %s, shape %s, data type %s, groups %d", |
|
|
|
op_desc_ptr->GetName().c_str(), TypeUtils::FormatToSerialString(src_format).c_str(), |
|
|
|
formats::ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(src_data_type).c_str(), |
|
|
|
TypeUtils::FormatToSerialString(const_weight_ptr->GetTensorDesc().GetFormat()).c_str(), |
|
|
|
formats::ShapeToString(const_weight_ptr->GetTensorDesc().GetShape()).c_str(), |
|
|
|
TypeUtils::DataTypeToSerialString(const_weight_ptr->GetTensorDesc().GetDataType()).c_str(), |
|
|
|
TypeUtils::FormatToSerialString(data_format).c_str(), formats::ShapeToString(data_shape).c_str(), |
|
|
|
TypeUtils::DataTypeToSerialString(data_type).c_str()); |
|
|
|
TypeUtils::DataTypeToSerialString(data_type).c_str(), groups); |
|
|
|
|
|
|
|
const uint8_t *src_data = const_weight_ptr->GetData().data(); |
|
|
|
const formats::TransArgs trans_args{src_data, src_format, data_format, src_shape, data_shape, src_data_type}; |
|
|
|
@@ -113,6 +114,15 @@ Status TransdataKernel::Compute(const OpDescPtr op_desc_ptr, const std::vector<C |
|
|
|
GELOGI("CheckSize failed, input size is not equal to weight size"); |
|
|
|
return NOT_CHANGED; |
|
|
|
} |
|
|
|
if((src_format == FOMAT_HWCN) && (data_format == FORMAT_FRACTAL_Z_3D)) { |
|
|
|
if (formats::TransFormat(trans_args, trans_result , groups) != SUCCESS) { |
|
|
|
GELOGW("Failed to trans formats from %s to %s, shape %s to %s, data type %s", |
|
|
|
TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(data_format).c_str(), |
|
|
|
formats::ShapeToString(src_shape).c_str(), formats::ShapeToString(data_shape).c_str(), |
|
|
|
TypeUtils::DataTypeToSerialString(src_data_type).c_str()); |
|
|
|
return NOT_CHANGED; |
|
|
|
} |
|
|
|
} |
|
|
|
if (formats::TransFormat(trans_args, trans_result) != SUCCESS) { |
|
|
|
GELOGW("Failed to trans formats from %s to %s, shape %s to %s, data type %s", |
|
|
|
TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(data_format).c_str(), |
|
|
|
|