def __init__(self, input_shape, weighted=True):
        """Initializer for Graph.
        """
        self.input_shape = input_shape
        self.weighted = weighted
        self.node_list = []
        self.layer_list = []
        # node id start with 0
        self.node_to_id = {}
        self.layer_to_id = {}
        self.layer_id_to_input_node_ids = {}
        self.layer_id_to_output_node_ids = {}
        self.adj_list = {}
        self.reverse_adj_list = {}
        self.operation_history = []
        self.n_dim = len(input_shape) - 1
        self.conv = get_conv_class(self.n_dim)
        self.batch_norm = get_batch_norm_class(self.n_dim)

        self.vis = None
        self._add_node(Node(input_shape))
def __init__ ( self , input_shape , weighted = True ) : self . input_shape = input_shape self . weighted = weighted self . node_list = [ ] self . layer_list = [ ] self . node_to_id = { } self . layer_to_id = { } self . layer_id_to_input_node_ids = { } self . layer_id_to_output_node_ids = { } self . adj_list = { } self . reverse_adj_list = { } self . operation_history = [ ] self . n_dim = len ( input_shape ) - 1 self . conv = get_conv_class ( self . n_dim ) self . batch_norm = get_batch_norm_class ( self . n_dim ) self . vis = None self . _add_node ( Node ( input_shape ) )
Initializer for Graph.