Using Tensor.ReverseDimension(slice, dimension) on a TensorSpan created via TensorSpan.Slice creates a tensor with partially invalid values - in this case, the source tensor has no '0' values, but the result has two of them.
Reproduction Steps
var t = Tensor.Create([1,2,3, 4,5,6, 7,8,9], [3, 3]);
var slice = t.AsTensorSpan().Slice([0..3, 1..3]);
var reversed = Tensor.ReverseDimension<int>(slice, 0);
Console.WriteLine(reversed.ToString([]));
Description
Using
Tensor.ReverseDimension(slice, dimension)
on aTensorSpan
created viaTensorSpan.Slice
creates a tensor with partially invalid values - in this case, the source tensor has no '0' values, but the result has two of them.Reproduction Steps
Expected behavior
Program prints
Actual behavior
Program prints
Regression?
No response
Known Workarounds
Using the copying
Tensor.Slice
method instead works.Configuration
.NET version: 9.0.100-rc.1.24452.12 OS: Windows 10 Education 22H2 Architecture: x64 (Intel Core i7-7700)
Other information
No response