introduction to pytorch in [ ] shape out[ ]torch size([ ]in [ ]index torch longtensor([ ]in [ ] torch index_select( indexin [ ] out[ ]tensor([[ ][ ]]in [ ] shape out[ ]torch size([ ]in [ ] torch index_select( indexin [ ] out[ ]tensor([[ ][ ][ ]]in [ ] shape out[ ]torch size([ ]the masked_select methodillustrated in listing - allows you to select elements given boolean mask listing - selecting elements from tensor using masked_ select in [ ] torch floattensor([[ , ],[ ][ ]]in [ ] out[ ]tensor([[ ]