Building the CNN graph