Hardshrink doesn't support cuda.FloatTensor?

Hi, all,

when I tried to implement:

m = nn.Hardshrink()
input = Variable(torch.randn(2)).cuda()

It showed hard shrink_forward is not implemented for type torch.cuda.FloatTensor.
However, when I tried Softshrink, it worked. Does this mean this function doesn’t support cuda?
Thanks in advance!

That’s correct, there’s currently no CUDA version of HardShrink.

Are we planning to have that? It seems strange that softshrink has while hardshrink doesnot.

It’s probably a good thing to have. I’ve opened a feature request for it here.

Thanks. Hope this will be resolved soon.

hi all, almost half year passed, is any solution here for this problem?

The issue is still open, so not yet.

I am also using HardShrink function and trying to put my model on cuda. Is there a projected time for when that will be fixed?

It’s now implemented on GitHub master by @Wei_Yang!

Thanks for the notice!!