Hi
while i was running gradient algorithm on this code:

  
      github.com
  
  
    BINDS-LAB-UMASS/bindsnet_experiments/blob/master/experiments/mnist/surrogate_gradient.py 18
from typing import Optional, Union

import torch
from torch import optim
import torch.nn.functional as F
from torch.autograd import Function
from torchvision import datasets, transforms


def fast_sigmoid(h):
    return h / (1 + torch.abs(h))

def grad_fast_sigmoid(h):
    return 1 / ((1 + torch.abs(h)) ** 2)


class LIFFunction(Function):

    @staticmethod
    def forward(ctx, x, v, decay, rest, thresh):


  This file has been truncated. show original

  
  
    
    
  
  


I got this error:
RuntimeError: Expected isFloatingType(grads[i].type().scalarType()) to be true, but got false. 

I have no idea how to correct it
Could someone  please give me a help??