def METHOD_NAME(self, graph, global_step=None, graph_def=None):
    if isinstance(graph_def, graph_pb2.GraphDef):
        tf_graph_def = tf.compat.v1.GraphDef.FromString(
            graph_def.SerializeToString()
        )
    else:
        tf_graph_def = graph_def
    super().METHOD_NAME(
        graph, global_step=global_step, graph_def=tf_graph_def
    )