21 writes to _shape
System.Numerics.Tensors (21)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (17)
41
_shape
= TensorShape.Create(array);
59
_shape
= TensorShape.Create(array, lengths);
81
_shape
= TensorShape.Create(array, lengths, strides);
105
_shape
= TensorShape.Create(array, start, lengths, strides);
117
_shape
= TensorShape.Create(ref reference, span.Length);
132
_shape
= TensorShape.Create(ref reference, span.Length, lengths);
151
_shape
= TensorShape.Create(ref reference, span.Length, lengths, strides);
163
_shape
= TensorShape.Create(array);
190
_shape
= TensorShape.Create(array, start, lengths, strides, out nint linearOffset);
205
_shape
= TensorShape.Create(data, dataLength);
224
_shape
= TensorShape.Create(data, dataLength, lengths);
247
_shape
= TensorShape.Create(data, dataLength, lengths, strides);
254
_shape
= TensorShape.Create(ref data, dataLength);
260
_shape
= TensorShape.Create(ref data, dataLength, lengths);
266
_shape
= TensorShape.Create(ref data, dataLength, lengths, strides);
272
_shape
= TensorShape.Create(ref data, dataLength, lengths, strides, linearRankOrder);
279
_shape
= shape;
System\Numerics\Tensors\netcore\TensorOperation.cs (4)
34
ref readonly TensorShape destinationShape = ref ((x._shape.FlattenedLength > y._shape.FlattenedLength) ? ref x.
_shape
: ref y.
_shape
);
226
ref readonly TensorShape destinationShape = ref ((x._shape.FlattenedLength > y._shape.FlattenedLength) ? ref x.
_shape
: ref y.
_shape
);
76 references to _shape
System.Numerics.Tensors (76)
System\Numerics\Tensors\netcore\ReadOnlyTensorDimensionSpan_1.cs (1)
49
nint linearOffset = _tensor.
_shape
.GetLinearOffset(index, _dimension);
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (21)
285
get => ref Unsafe.Add(ref _reference,
_shape
.GetLinearOffset<TensorShape.GetOffsetAndLengthForNInt, nint>(indexes));
291
get => ref Unsafe.Add(ref _reference,
_shape
.GetLinearOffset<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(indexes));
301
public nint FlattenedLength =>
_shape
.FlattenedLength;
304
public bool HasAnyDenseDimensions =>
_shape
.HasAnyDenseDimensions;
307
public bool IsDense =>
_shape
.IsDense;
310
public bool IsEmpty =>
_shape
.IsEmpty;
314
public ReadOnlySpan<nint> Lengths =>
_shape
.Lengths;
321
public ReadOnlySpan<nint> Strides =>
_shape
.Strides;
330
&& left.
_shape
== right.
_shape
;
354
items.
_shape
407
if (
_shape
.FlattenedLength != 0) ret = ref _reference;
414
TensorShape shape =
_shape
.Slice<TensorShape.GetOffsetAndLengthForNInt, nint>(startIndexes, out nint linearOffset);
424
TensorShape shape =
_shape
.Slice<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(startIndexes, out nint linearOffset);
434
TensorShape shape =
_shape
.Slice<TensorShape.GetOffsetAndLengthForNRange, NRange>(ranges, out nint linearOffset);
443
public override string ToString() => $"System.Numerics.Tensors.ReadOnlyTensorSpan<{typeof(T).Name}>[{
_shape
}]";
448
if (TensorShape.AreCompatible(destination._shape,
_shape
, false))
459
if (
_shape
.FlattenedLength <= destination.Length)
492
if (_itemsEnumerated == _span.
_shape
.FlattenedLength)
497
_linearOffset = _span.
_shape
.AdjustToNextIndex(_span.
_shape
, _linearOffset, _indexes);
System\Numerics\Tensors\netcore\Tensor.cs (20)
1634
ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor.
_shape
.LinearLength, newLengths, strides);
1691
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref tensor._reference, (int)tensor.
_shape
.LinearLength);
1787
&& tensor._shape.LinearLength == other.
_shape
.LinearLength
1789
&& MemoryMarshal.CreateReadOnlySpan(in tensor.GetPinnableReference(), (int)tensor._shape.LinearLength).SequenceEqual(MemoryMarshal.CreateReadOnlySpan(in other.GetPinnableReference(), (int)other.
_shape
.LinearLength));
1799
&& tensor.
_shape
.LinearLength == other.
_shape
.LinearLength
1801
&& MemoryMarshal.CreateReadOnlySpan(in tensor.GetPinnableReference(), (int)tensor.
_shape
.LinearLength).SequenceEqual(MemoryMarshal.CreateReadOnlySpan(in other.GetPinnableReference(), (int)other.
_shape
.LinearLength));
1871
outputs[i] = new Tensor<T>(values, 0, newShape, [], tensor.
_shape
.LinearRankOrder);
2086
strideOrder[index++] = tensor.
_shape
.LinearRankOrder[i];
2090
removed[removedIndex++] = tensor.
_shape
.LinearRankOrder[i];
2110
strideOrder[index++] = tensor.
_shape
.LinearRankOrder[i];
2114
removed = tensor.
_shape
.LinearRankOrder[i];
2120
ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor.
_shape
.LinearLength, lengths[..newRank], strides[..newRank], strideOrder[..newRank]);
2402
if (!TensorShape.AreCompatible(destination._shape, tensor.
_shape
, false))
2516
ReadOnlyTensorSpan<T> output = new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor.
_shape
.LinearLength, newLengths, newStrides);
3911
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
.LinearLength);
3923
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
.LinearLength);
3934
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
.LinearLength);
3947
ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref x._reference, (int)x.
_shape
.LinearLength);
System\Numerics\Tensors\netcore\TensorOperation.cs (34)
34
ref readonly TensorShape destinationShape = ref ((x.
_shape
.FlattenedLength > y.
_shape
.FlattenedLength) ? ref x._shape : ref y._shape);
40
xLinearOffset = x.
_shape
.AdjustToNextIndex(destinationShape, xLinearOffset, xIndexes);
41
yLinearOffset = y.
_shape
.AdjustToNextIndex(destinationShape, yLinearOffset, yIndexes);
70
xLinearOffset = x.
_shape
.AdjustToNextIndex(x.
_shape
, xLinearOffset, xIndexes);
114
xLinearOffset = x.
_shape
.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes);
142
xLinearOffset = x.
_shape
.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes);
164
xLinearOffset = x.
_shape
.AdjustToNextIndex(x.
_shape
, xLinearOffset, xIndexes);
183
xLinearOffset = x.
_shape
.AdjustToNextIndex(x.
_shape
, xLinearOffset, xIndexes);
203
xLinearOffset = x.
_shape
.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes);
204
yLinearOffset = y.
_shape
.AdjustToNextIndex(destination._shape, yLinearOffset, yIndexes);
226
ref readonly TensorShape destinationShape = ref ((x.
_shape
.FlattenedLength > y.
_shape
.FlattenedLength) ? ref x._shape : ref y._shape);
233
xLinearOffset = x.
_shape
.AdjustToNextIndex(destinationShape, xLinearOffset, xIndexes);
234
yLinearOffset = y.
_shape
.AdjustToNextIndex(destinationShape, yLinearOffset, yIndexes);
263
xLinearOffset = x.
_shape
.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes);
285
xLinearOffset = y.
_shape
.AdjustToNextIndex(destination._shape, xLinearOffset, xIndexes);
306
xLinearOffset = x.
_shape
.AdjustToNextIndex(x.
_shape
, xLinearOffset, xIndexes);
324
if (!TensorShape.AreCompatible(lengths, x.
_shape
))
331
if (!TensorShape.AreCompatible(x.
_shape
, y.
_shape
, true))
338
if (!TensorShape.AreCompatible(destination._shape, x.
_shape
, false))
345
if (TensorShape.AreCompatible(x.
_shape
, y.
_shape
, true))
347
if (TensorShape.AreCompatible(destination._shape, x.
_shape
, false))
349
if (TensorShape.AreCompatible(destination._shape, y.
_shape
, false))
362
if (TensorShape.AreCompatible(x.
_shape
, y.
_shape
, true))
366
destination = Tensor.CreateUninitialized<TResult>(x.
_shape
.Lengths);
370
destination = Tensor.CreateUninitialized<TResult>(y.
_shape
.Lengths);