def get_node_io_shapes(node, key):
  """Returns the input/output shapes of a GraphDef Node."""
  out_shape = []
  for shape in node.attr[key].list.shape:
    out_shape.append([dim.size for dim in shape.dim])
  return out_shape