Creates a simple node that holds tensor value.
| 595 | |
| 596 | // Creates a simple node that holds tensor value. |
| 597 | Status NewConstNode(TensorFloat32 t, GraphFloat32* graph, |
| 598 | Value<TensorRef<BHWC>>** value) { |
| 599 | ConstTensorAttributes attr; |
| 600 | attr.tensor = std::move(t); |
| 601 | Node* node = graph->NewNode(); |
| 602 | node->operation.attributes = attr; |
| 603 | node->operation.type = ToString(OperationType::CONST); |
| 604 | *value = graph->NewValue(); |
| 605 | RETURN_IF_ERROR(graph->SetProducer(node->id, (*value)->id)); |
| 606 | // Keep data inside this tensor. |
| 607 | (*value)->tensor.ref = attr.tensor.id; |
| 608 | (*value)->tensor.type = attr.tensor.kType; |
| 609 | (*value)->tensor.shape = attr.tensor.shape; |
| 610 | return OkStatus(); |
| 611 | } |
| 612 | |
| 613 | Status ParsePoolingAttributes(const TfLitePoolParams* tf_options, |
| 614 | const BHWC& input_shape, |