Display the names of the custom ops in the graph display, as well "Ops" and "Operator Codes" tables.

PiperOrigin-RevId: 356857986
Change-Id: I82c835c572877fedd7ce1a452a83d25819407d9f
This commit is contained in:
Shlomi Regev 2021-02-10 16:44:47 -08:00 committed by TensorFlower Gardener
parent f987ff6bcd
commit 4f06d670ff

View File

@ -234,6 +234,8 @@ class OpCodeMapper(object):
self.code_to_name = {}
for idx, d in enumerate(data["operator_codes"]):
self.code_to_name[idx] = BuiltinCodeToName(d["builtin_code"])
if self.code_to_name[idx] == "CUSTOM":
self.code_to_name[idx] = NameListToString(d["custom_code"])
def __call__(self, x):
if x not in self.code_to_name:
@ -450,7 +452,7 @@ def CreateHtmlFile(tflite_input, html_output):
# Spec on what keys to display
buffer_keys_to_display = [("data", DataSizeMapper())]
operator_keys_to_display = [("builtin_code", BuiltinCodeToName),
("custom_code", None),
("custom_code", NameListToString),
("version", None)]
# Update builtin code fields.