x=torch.Tensor({1,-1,3,-8})
如何进行转换x,使得 x 中的所有负值都替换为零,而不使用循环,使得张量必须看起来像
x
th>x 1 0 3 0
lua torch
lua ×1
torch ×1