I am quite new to pytorch and I am looking at this piece of code:

  
      github.com
  
  
    WillKoehrsen/pytorch_challenge/blob/master/Transfer Learning in PyTorch.ipynb 2
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Introduction: Transfer Learning in PyTorch\n",
    "\n",
    "In this notebook, we'll see how to use PyTorch to train a classifier to identify 101 different objects in images. Through this project, we'll get familiar with the basics of transfer learning, PyTorch, convolutional neural networks, and inference. \n",
    "\n",
    "## Dataset: CalTech 101\n",
    "\n",
    "The dataset is the [CalTech 101 collection](http://www.vision.caltech.edu/Image_Datasets/Caltech101/) of images from 101 categories. There are about 40 to 800 images in each category. I've reduced the number of categories to 100 and arranged them in three sets: train, valid, test with a split of 50%, 25%, and 25%. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],


  This file has been truncated. show original

  
  
    
    
  
  


I see that the author does this (see in In[30] for example):
# Attach the optimizer
model.optimizer = optimizer

What is the point of doing this? The examples shown on PyTorch’s website for training, never uses this attaching concept.
Am perplexed as to why one needs this. Any pointers would be useful…