| 946 | } |
| 947 | |
| 948 | tensorflow::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 | |
| 971 | tensorflow::Status ConvertSpaceToDepthOperator( |
| 972 | const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, |
nothing calls this directly
no test coverage detected