gist.github.com
  
  
    https://gist.github.com/InnovArul/ca0db578769186bbaf094c5f8416a8bc 146
filter_learning.py
from __future__ import print_function
import torch.nn.functional as F
# from torch.autograd import Variable
# import copy
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from torchvision import datasets, transforms

This file has been truncated. show original




  
  
    
    
  
  




Remember that pytorch is based on dynamic computation graphs, where as tensorflow is based on static computation graphs. Hence, you need to calculate filter in forward() rather than __init__().


You do not need to move individual parameters to cuda. Rather try to move whole model to cuda.