def memory_plan(self, feed_shapes):
    'Allocates ndarray.NDArray for every node except feed_dict nodes.\n\n        Implementation note:\n        Option 1: Alloc a ndarray.NDArray per node that persists across run()\n        Option 2: Implement a memory pool to reuse memory for nodes of same\n                shapes. More details see Lecture 7.\n\n        For both options, self.node_to_arr_map stores node->NDArray mapping to\n        allow mapping to persist across multiple executor.run().\n\n        Hint: use ndarray.empty(shape, ctx=self.ctx) to allocate NDArray.\n\n        Parameters\n        ----------\n        feed_shapes: node->shapes mapping for feed_dict nodes.\n        '
    'TODO: Your code here'
    assert (self.ctx is not None)
    self.node_to_arr_map = {}
    for (node, shape) in self.node_to_shape_map.items():
        if (self.policy == 'swap'):
            if (not node.swap):
                self.node_to_arr_map[node] = ndarray.empty(shape, ctx=self.ctx)
        elif (self.policy == 'vdnn'):
            self.node_to_arr_map[node] = np.empty(shape)
        else:
            self.node_to_arr_map[node] = ndarray.empty(shape, ctx=self.ctx)
Allocates ndarray.NDArray for every node except feed_dict nodes.

Implementation note:
Option 1: Alloc a ndarray.NDArray per node that persists across run()
Option 2: Implement a memory pool to reuse memory for nodes of same
        shapes. More details see Lecture 7.

For both options, self.node_to_arr_map stores node->NDArray mapping to
allow mapping to persist across multiple executor.run().

Hint: use ndarray.empty(shape, ctx=self.ctx) to allocate NDArray.

Parameters
----------
feed_shapes: node->shapes mapping for feed_dict nodes.
def memory_plan(self, feed_shapes):
    'Allocates ndarray.NDArray for every node except feed_dict nodes.\n\n        Implementation note:\n        Option 1: Alloc a ndarray.NDArray per node that persists across run()\n        Option 2: Implement a memory pool to reuse memory for nodes of same\n                shapes. More details see Lecture 7.\n\n        For both options, self.node_to_arr_map stores node->NDArray mapping to\n        allow mapping to persist across multiple executor.run().\n\n        Hint: use ndarray.empty(shape, ctx=self.ctx) to allocate NDArray.\n\n        Parameters\n        ----------\n        feed_shapes: node->shapes mapping for feed_dict nodes.\n        '
    'TODO: Your code here'
    assert (self.ctx is not None)
    self.node_to_arr_map = {}
    for (node, shape) in self.node_to_shape_map.items():
        if (self.policy == 'swap'):
            if (not node.swap):
                self.node_to_arr_map[node] = ndarray.empty(shape, ctx=self.ctx)
        elif (self.policy == 'vdnn'):
            self.node_to_arr_map[node] = np.empty(shape)
        else:
            self.node_to_arr_map[node] = ndarray.empty(shape, ctx=self.ctx)