dot-valueWeightIndexes function

Compute indexes for the value and weight layers that should be processed together