Commit aca04587 authored by Michael Kuperstein's avatar Michael Kuperstein Committed by TensorFlower Gardener
Browse files

[XLA] Clamp indices in DynamicSlice and DynamicUpdateSlice instead of wrapping.

This implements the following index clamping in all backends (CPU, GPU, Interpreter):

for(int i = 0; i < rank; ++i)
  start_index[i] = clamp(start_index[i], 0, output_dim_size[i] - update_dim_size[i])

Which ensures the slice (or update region) is always inbounds w.r.t the input.

PiperOrigin-RevId: 197082276
parent a7fcec1b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment