Makes a ValueInfoProto based on the data type and shape.
(
name: str,
elem_type: int,
shape: Sequence[str | int | None] | None,
doc_string: str = "",
shape_denotation: list[str] | None = None,
)
| 828 | |
| 829 | |
| 830 | def make_tensor_value_info( |
| 831 | name: str, |
| 832 | elem_type: int, |
| 833 | shape: Sequence[str | int | None] | None, |
| 834 | doc_string: str = "", |
| 835 | shape_denotation: list[str] | None = None, |
| 836 | ) -> ValueInfoProto: |
| 837 | """Makes a ValueInfoProto based on the data type and shape.""" |
| 838 | value_info_proto = ValueInfoProto() |
| 839 | value_info_proto.name = name |
| 840 | if doc_string: |
| 841 | value_info_proto.doc_string = doc_string |
| 842 | |
| 843 | tensor_type_proto = make_tensor_type_proto(elem_type, shape, shape_denotation) |
| 844 | value_info_proto.type.CopyFrom(tensor_type_proto) |
| 845 | return value_info_proto |
| 846 | |
| 847 | |
| 848 | def make_sparse_tensor_type_proto( |
searching dependent graphs…