Given a tensor of values with dimensions [batch, values], I need to get the minimum value that occurs before the maximum value. Thus, this naive approach:
This obviously didn’t work as the slice is a tensor of dimension [batch]. But I feel like there should be a simple answer here… anyone have a good idea?
Depending on your situation, overwriting the relevant data indices might be an alternative to avoid allocating masked_data as a tensor, but I generally advise against using inplace unless you absolutely need to.