[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
Loading
Please sign in to comment