What should the output tensor contain for the values smaller than your threshold? If you would like to fill it with default value, you could initialize the result tensor with these default values and use scatter to fill in the values meeting your threshold (torch.where might also work).