Hi,
I think you want to use directly the nn functional version of threshold:
import torch
from torch.autograd import Variable
import torch.nn as nn

x = Variable(torch.rand(10))
maxx = torch.max(x)
y = nn.functional.threshold(x, 0.6*maxx.data[0], 0)

EDIT: access the content of the maxx Variable since we don’t want to propagate through it.