MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ConvertDepthToSpaceOperator

Function ConvertDepthToSpaceOperator

tensorflow/lite/toco/import_tensorflow.cc:948–969  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

946}
947
948tensorflow::Status ConvertDepthToSpaceOperator(
949 const NodeDef& node, const TensorFlowImportFlags& tf_import_flags,
950 const ModelFlags& model_flags, Model* model) {
951 CHECK_EQ(node.op(), "DepthToSpace");
952 TF_QCHECK_OK(CheckInputsCount(node, tf_import_flags, 1));
953
954 tensorflow::DataType dtype = GetDataTypeAttr(node, "T");
955 if (dtype != DT_FLOAT && dtype != DT_UINT8 && dtype != DT_INT32 &&
956 dtype != DT_INT64) {
957 const auto* enum_descriptor = tensorflow::DataType_descriptor();
958 LOG(FATAL) << "TFLite does not support DepthToSpace with type T:"
959 << enum_descriptor->FindValueByNumber(dtype)->name() << ". "
960 << "T must be one of {DT_FLOAT, DT_UINT8, DT_INT32, DT_INT64}.";
961 }
962 auto* op = new DepthToSpaceOperator;
963 op->inputs.push_back(node.input(0));
964 op->outputs.push_back(node.name());
965 op->block_size = GetIntAttr(node, "block_size");
966 QCHECK_GE(op->block_size, 2);
967 model->operators.emplace_back(op);
968 return tensorflow::Status::OK();
969}
970
971tensorflow::Status ConvertSpaceToDepthOperator(
972 const NodeDef& node, const TensorFlowImportFlags& tf_import_flags,

Callers

nothing calls this directly

Calls 8

CheckInputsCountFunction · 0.85
GetDataTypeAttrFunction · 0.85
GetIntAttrFunction · 0.85
nameMethod · 0.65
opMethod · 0.45
push_backMethod · 0.45
inputMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected