Solved by ptrblck in post #4 
              
              
                I agree with @googlebot what capturing the profiling information would be confusing and bad. 
Note that your current code snippet uses a BoolTensor to index a, which will yield a variable sized output tensor (in your example you are using torch.ones_like, so all values would be returned). 
This woul…