class_docstr: Customed Graph class.
docstr: update hash id of each layer, in topological order/recursively
  hash id will be used in weight sharing
docstr_tok: ["update","hash","id","of","each","layer",",","in","topological","order\/recursively","hash","id","will","be","used","in","weight","sharing"]
code: def update_hash(self):
      """
      update hash id of each layer, in topological order/recursively
      hash id will be used in weight sharing
      """
      _logger.debug("update hash")
      layer_in_cnt = [len(layer.input) for layer in self.layers]
      topo_queue = deque(
          [
              i
              for i, layer in enumerate(self.layers)
              if not layer.is_delete
              and layer.graph_type == LayerType.input.value
          ]
      )
      while topo_queue:
          layer_i = topo_queue.pop()
          self.layers[layer_i].update_hash(self.layers)
          for layer_j in self.layers[layer_i].output:
              layer_in_cnt[layer_j] -= 1
              if layer_in_cnt[layer_j] == 0:
                  topo_queue.appendleft(layer_j)
  
imports: import copy
  import hashlib
  import logging
  import json
  import random
  from collections import deque
  from enum import Enum, unique
  from typing import Iterable
  import numpy
label_desc: Use image node_id 5 for calling the Graph obj's underlying member method code with example usage: obj.update_hash() without return types