11 writes to _shape
System.Numerics.Tensors (11)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (11)
40
_shape
= TensorShape.Create(array);
75
_shape
= TensorShape.Create(array, lengths, strides);
99
_shape
= TensorShape.Create(array, start, lengths, strides);
111
_shape
= TensorShape.Create(ref reference, span.Length, pinned: false);
141
_shape
= TensorShape.Create(ref reference, span.Length, lengths, strides, pinned: false);
156
_shape
= TensorShape.Create(array);
186
_shape
= TensorShape.Create(array, start, lengths, strides, out nint linearOffset);
201
_shape
= TensorShape.Create(data, dataLength);
240
_shape
= TensorShape.Create(data, dataLength, lengths, strides);
246
_shape
= TensorShape.CreateForView(dataLength, lengths, strides, pinned);
253
_shape
= shape;
113 references to _shape
System.Numerics.Tensors (113)
System\Numerics\Tensors\netcore\ReadOnlyTensorDimensionSpan_1.cs (2)
24
tensor = new ReadOnlyTensorSpan<T>(in tensor._reference, TensorShape.Normalize(tensor.
_shape
));
59
nint linearOffset = _tensor.
_shape
.GetLinearOffsetForDimension(index, _dimension);
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (23)
259
get => ref Unsafe.Add(ref _reference,
_shape
.GetLinearOffset<TensorShape.GetOffsetAndLengthForNInt, nint>(indexes));
265
get => ref Unsafe.Add(ref _reference,
_shape
.GetLinearOffset<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(indexes));
275
public nint FlattenedLength =>
_shape
.FlattenedLength;
278
public bool HasAnyDenseDimensions =>
_shape
.HasAnyDenseDimensions;
281
public bool IsDense =>
_shape
.IsDense;
284
public bool IsEmpty =>
_shape
.IsEmpty;
287
public bool IsPinned =>
_shape
.IsPinned;
291
public ReadOnlySpan<nint> Lengths =>
_shape
.Lengths;
298
public ReadOnlySpan<nint> Strides =>
_shape
.Strides;
307
&& left.
_shape
== right.
_shape
;
331
items.
_shape
384
if (
_shape
.FlattenedLength != 0) ret = ref _reference;
411
TensorShape shape =
_shape
.Slice<TensorShape.GetOffsetAndLengthForSlice, nint>(startIndexes, out nint linearOffset);
421
TensorShape shape =
_shape
.Slice<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(startIndexes, out nint linearOffset);
431
TensorShape shape =
_shape
.Slice<TensorShape.GetOffsetAndLengthForNRange, NRange>(ranges, out nint linearOffset);
456
if ((
_shape
.FlattenedLength <= destination.FlattenedLength) &&
457
TensorShape.AreCompatible(destination._shape,
_shape
, false))
468
if (
_shape
.FlattenedLength <= destination.Length)
480
nint longestContiguousLength =
_shape
.GetLongestContiguousLength<TensorShape.GetOffsetAndLengthForNInt, nint>(startIndexes, out nint linearOffset);
496
nint longestContiguousLength =
_shape
.GetLongestContiguousLength<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(startIndexes, out nint linearOffset);
574
if (_itemsEnumerated == _span.
_shape
.FlattenedLength)
582
: _span.
_shape
.GetLinearOffsetForDimension(_itemsEnumerated, _span.Rank);
System\Numerics\Tensors\netcore\Tensor.cs (19)
274
if (source.
_shape
.Overlaps(in source._reference, ref destination._reference, destinationLinearLength))
325
source = new ReadOnlyTensorSpan<T>(in source._reference, TensorShape.WithRank(source.
_shape
, targetRank));
464
source = new ReadOnlyTensorSpan<T>(in source._reference, TensorShape.WithRank(source.
_shape
, rank));
1770
ref readonly TensorShape shape = ref TensorShape.Normalize(tensor.
_shape
);
1781
ReadOnlyTensorSpan<T> result = new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor.
_shape
.LinearLength, newLengths, strides, tensor.IsPinned);
1889
if (tensor.
_shape
.Overlaps(in tensor._reference, ref destination._reference, destination._shape.LinearLength))
2035
if (dimension < -1 || dimension >= TensorShape.Normalize(tensor.
_shape
).Rank)
2044
if (tensor.
_shape
.Overlaps(in tensor._reference, ref destination._reference, destination._shape.LinearLength))
2047
&& TensorShape.AreLayoutsTheSame(tensor.
_shape
, destination._shape))
2049
if ((tensor.
_shape
.LinearLength == 1) || (dimension >= 0 && tensor.Lengths[dimension] == 1))
2302
alignedOther = new ReadOnlyTensorSpan<T>(in other._reference, TensorShape.WithRank(other.
_shape
, rank));
2306
? TensorOperation.GetDenseSliceDimension(tensor.
_shape
, alignedOther.
_shape
)
2407
ref readonly TensorShape shape = ref TensorShape.Normalize(tensor.
_shape
);
2680
ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor.
_shape
.LinearLength, lengths[..rank], strides[..rank], tensor.IsPinned);
2889
nint linearOffset = tensor.
_shape
.GetLinearOffsetForDimension(i, 1);
3032
if (!TensorShape.AreCompatible(destination._shape, tensor.
_shape
, false))
3145
ref readonly TensorShape shape = ref TensorShape.Normalize(tensor.
_shape
);
3177
ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor.
_shape
.LinearLength, newLengths, newStrides, tensor.IsPinned);
System\Numerics\Tensors\netcore\TensorOperation.cs (69)
28
if (!source.
_shape
.Overlaps(in source._reference, ref destination._reference, destination._shape.LinearLength))
37
&& TensorShape.AreLayoutsTheSame(source.
_shape
, destination._shape))
43
if (!source.
_shape
.IsSelfOverlapping)
105
|| !source.
_shape
.Overlaps(in source._reference, ref destination._reference, destination._shape.LinearLength));
107
int sourceDimension = source.IsDense ? -1 : GetDenseSliceDimension(source.
_shape
, source.
_shape
);
163
int sourceDimension = input.IsDense ? -1 : GetDenseSliceDimension(input.
_shape
, input.
_shape
);
420
TensorShape shape = TensorShape.Create(in source._reference, source.
_shape
.LinearLength, destination.Lengths, strides, source.IsPinned);
514
int dimension = GetDenseSliceDimension(x.
_shape
, x.
_shape
);
565
linearOffset = x.
_shape
.AdjustToNextIndex(x.
_shape
, linearOffset, indexes);
684
TensorShape destinationShape = GetBroadcastShape(x.
_shape
, y.
_shape
);
703
int dimension = GetDenseSliceDimension(optimizedX.
_shape
, destinationShape, optimizedY.
_shape
, MinSlicedBinaryOperationLength);
722
xLinearOffset = x.
_shape
.AdjustToNextIndex(destinationShape, xLinearOffset, xIndexes);
723
yLinearOffset = y.
_shape
.AdjustToNextIndex(destinationShape, yLinearOffset, yIndexes);
726
xLinearOffset = x.
_shape
.AdjustToNextIndex(destinationShape, xLinearOffset, xIndexes);
727
yLinearOffset = y.
_shape
.AdjustToNextIndex(destinationShape, yLinearOffset, yIndexes);
816
int dimension = GetDenseSliceDimension(x.
_shape
, x.
_shape
);
833
xLinearOffset = x.
_shape
.AdjustToNextIndex(x.
_shape
, xLinearOffset, xIndexes);
836
xLinearOffset = x.
_shape
.AdjustToNextIndex(x.
_shape
, xLinearOffset, xIndexes);
952
int dimension = GetDenseSliceDimension(optimizedSource.
_shape
, destination._shape);
974
xLinearOffset = source.
_shape
.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes);
1006
xLinearOffset = source.
_shape
.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes);
1034
if (x.
_shape
.Overlaps(in x._reference, ref destinationReference, result.Length))
1040
? GetDenseSliceDimension(x.
_shape
, x.
_shape
)
1064
xLinearOffset = x.
_shape
.AdjustToNextIndex(x.
_shape
, xLinearOffset, xIndexes);
1096
int dimension = GetDenseSliceDimension(x.
_shape
, x.
_shape
);
1111
xLinearOffset = x.
_shape
.AdjustToNextIndex(x.
_shape
, xLinearOffset, xIndexes);
1174
int dimension = GetDenseSliceDimension(optimizedX.
_shape
, destination._shape, optimizedY.
_shape
, MinSlicedBinaryOperationLength);
1200
xLinearOffset = left.
_shape
.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes);
1201
yLinearOffset = right.
_shape
.AdjustToNextIndex(destination._shape, yLinearOffset, yIndexes);
1240
TensorShape destinationShape = GetBroadcastShape(x.
_shape
, y.
_shape
);
1249
int dimension = GetDenseSliceDimension(optimizedX.
_shape
, destinationShape, optimizedY.
_shape
, MinSlicedBinaryOperationLength);
1266
xLinearOffset = x.
_shape
.AdjustToNextIndex(destinationShape, xLinearOffset, xIndexes);
1267
yLinearOffset = y.
_shape
.AdjustToNextIndex(destinationShape, yLinearOffset, yIndexes);
1309
int dimension = GetDenseSliceDimension(optimizedSource.
_shape
, destination._shape);
1331
xLinearOffset = source.
_shape
.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes);
1366
int dimension = GetDenseSliceDimension(optimizedSource.
_shape
, destination._shape);
1388
xLinearOffset = source.
_shape
.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes);
1422
int dimension = GetDenseSliceDimension(x.
_shape
, x.
_shape
);
1437
xLinearOffset = x.
_shape
.AdjustToNextIndex(x.
_shape
, xLinearOffset, xIndexes);
1455
if (!TensorShape.AreCompatible(lengths, x.
_shape
))
1462
if (!TensorShape.AreCompatible(x.
_shape
, y.
_shape
, true))
1469
if (!TensorShape.AreCompatible(destination._shape, x.
_shape
, false))
1476
if (TensorShape.AreCompatible(x.
_shape
, y.
_shape
, true))
1478
if (TensorShape.AreCompatible(destination._shape, x.
_shape
, false))
1480
if (TensorShape.AreCompatible(destination._shape, y.
_shape
, false))
1493
if (TensorShape.AreCompatible(x.
_shape
, y.
_shape
, true))
1495
ref readonly TensorShape xShape = ref TensorShape.Normalize(x.
_shape
);
1496
ref readonly TensorShape yShape = ref TensorShape.Normalize(y.
_shape
);