Hi.
I have a very simple question. Given a tensor T = torch.Tensor([1,2,3,4]) , I need a temporary copy with the first s elements set to 0?
For now, I have the following:
T_tmp = T.clone()
T_tmp [:s] = 0
distribution(T_tmp…)
I am wondering if there are better alternatives because I only need to pass the copy through a function (distribution), and preceding my call with two lines is annoying.
Thanks!