Suponiendo que tenemos los tensores de antorcha:
A: with shape BxHxW and values in {0,1}, where 0 and 1 are classes B: with shape Bx2xD and real values, where D is the dimensionality of our vector We want to create a new tensor of shape BxDxHxW that holds in each index specified in the spatial dimension (HxW), the vector that corresponds to its class (specified by A).¿Hay una función en pytorch que implemente eso? Probé la dispersión de la antorcha pero creo que este no es el caso.