We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c6d61d commit 6abd7efCopy full SHA for 6abd7ef
src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorShape.cs
@@ -1101,7 +1101,11 @@ private void ValidateState()
1101
{
1102
if (IsDense)
1103
1104
- Debug.Assert(!IsEmpty);
+ // We don't assert !IsEmpty as a zero lengthed slice that
1105
+ // tracks a byref to physical memory will still be marked
1106
+ // as dense. This is in contrast to the default empty span
1107
+ // which is not.
1108
+
1109
Debug.Assert(FlattenedLength == LinearLength);
1110
Debug.Assert(HasAnyDenseDimensions);
1111
}
0 commit comments