Description
When it use Tensor.Resize with Tensor whose starting postion(start) is greater than 0, the resulting values differ from the expected value.
For example, resizing a Tensor created with Tensor.Create([1, 2, 3, 4, 5, 6], start: 2, lengths: [4], strides: []) produces a Tensor containing [5, 6, 0, 0] instead of [3, 4, 5, 6].
Reproduction Steps
Tensor<int> tensor = Tensor.Create([1, 2, 3, 4, 5, 6], start: 2, lengths: [4], strides: []); // return [3, 4, 5, 6]
Tensor<int> resizedTensor = Tensor.Resize(tensor, [4]); // [5, 6, 0, 0] (should return [3, 4, 5, 6])
Expected behavior
The resized Tensor starts from _values[_start]
Actual behavior
The resized Tensor starts from _values[_start * 2] because _start is applied twice.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
I have created a pull request (#128511).
Description
When it use
Tensor.ResizewithTensorwhose starting postion(start) is greater than 0, the resulting values differ from the expected value.For example, resizing a
Tensorcreated withTensor.Create([1, 2, 3, 4, 5, 6], start: 2, lengths: [4], strides: [])produces aTensorcontaining[5, 6, 0, 0]instead of[3, 4, 5, 6].Reproduction Steps
Expected behavior
The resized
Tensorstarts from_values[_start]Actual behavior
The resized
Tensorstarts from_values[_start * 2]because_startis applied twice.Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
I have created a pull request (#128511).