| 2026 | } |
| 2027 | |
| 2028 | tensorflow::Status ConvertUnpackOperator( |
| 2029 | const NodeDef& node, const TensorFlowImportFlags& tf_import_flags, |
| 2030 | const ModelFlags& model_flags, Model* model) { |
| 2031 | CHECK_EQ(node.op(), "Unpack"); |
| 2032 | auto op = absl::make_unique<UnpackOperator>(); |
| 2033 | const int num_inputs = GetInputsCount(node, tf_import_flags); |
| 2034 | QCHECK_EQ(num_inputs, 1); |
| 2035 | op->inputs.push_back(node.input(0)); |
| 2036 | op->num = GetIntAttr(node, "num"); |
| 2037 | op->axis = HasAttr(node, "axis") ? GetIntAttr(node, "axis") : 0; |
| 2038 | op->dtype = ConvertDataType(toco::GetDataTypeAttr(node, "T")); |
| 2039 | |
| 2040 | op->outputs.push_back(node.name()); // Implicit :0. |
| 2041 | for (int i = 1; i < op->num; ++i) { |
| 2042 | op->outputs.push_back(node.name() + ":" + std::to_string(i)); |
| 2043 | } |
| 2044 | model->operators.emplace_back(std::move(op)); |
| 2045 | return tensorflow::Status::OK(); |
| 2046 | } |
| 2047 | |
| 2048 | // Some TensorFlow ops only occur in graph cycles, representing |
| 2049 | // control flow. We do not currently support control flow, so we wouldn't |
nothing calls this directly
no test coverage detected