def infer_shape(self, feed_shapes):
    'Given shapes of feed_dict nodes, infer shape for all nodes in graph.\n\n        Implementation note:\n        Iteratively calls node.op.infer_shape to infer shapes.\n        Node shapes stored in self.node_to_shape_map.\n\n        Parameters\n        ----------\n        feed_shapes: node->shapes mapping for feed_dict nodes.\n        '
    'TODO: Your code here'
    self.node_to_shape_map = {}
    for node in self.topo_order:
        if (node in feed_shapes):
            self.node_to_shape_map[node] = feed_shapes[node]
        else:
            input_shapes = [self.node_to_shape_map[n] for n in node.inputs]
            self.node_to_shape_map[node] = node.op.infer_shape(node, input_shapes)
Given shapes of feed_dict nodes, infer shape for all nodes in graph.

Implementation note:
Iteratively calls node.op.infer_shape to infer shapes.
Node shapes stored in self.node_to_shape_map.

Parameters
----------
feed_shapes: node->shapes mapping for feed_dict nodes.
def infer_shape(self, feed_shapes):
    'Given shapes of feed_dict nodes, infer shape for all nodes in graph.\n\n        Implementation note:\n        Iteratively calls node.op.infer_shape to infer shapes.\n        Node shapes stored in self.node_to_shape_map.\n\n        Parameters\n        ----------\n        feed_shapes: node->shapes mapping for feed_dict nodes.\n        '
    'TODO: Your code here'
    self.node_to_shape_map = {}
    for node in self.topo_order:
        if (node in feed_shapes):
            self.node_to_shape_map[node] = feed_shapes[node]
        else:
            input_shapes = [self.node_to_shape_map[n] for n in node.inputs]
            self.node_to_shape_map[node] = node.op.infer_shape(node, input_shapes)