I’m curious if its possible to do something like
np.random.choice([a, b], p=[p_a, p_b])
using PyTorch where
b are 1-d tensors of length L and
p_b are probabilities used to sample elements from either tensor
b into the resultant 1-d tensor.
torch.multinomial([p_a, p_b], L) might be useful here - it returns a 1-d tensor length
L of 0s and 1s based on the probabilities I give it but I’m drawing a blank of how to utilize this tensor to sample from my tensors
b. Appreciate any help!