I inserted a print statement in the code sample in the link below. It prints things fine.

  
      gist.github.com
  
  
    https://gist.github.com/anonymous/866455c6bdb88403d23d8c862b3b9233 274
foo.py
import torch
from torch.autograd import Variable, Function

class Linear(Function):

    # Note that both forward and backward are @staticmethods
    @staticmethod
    # bias is an optional argument
    def forward(ctx, input, weight, bias=None):
        ctx.save_for_backward(input, weight, bias)
This file has been truncated. show original