11 writes to _shape
System.Numerics.Tensors (11)
System\Numerics\Tensors\netcore\TensorSpan_1.cs (11)
41
_shape
= TensorShape.Create(array);
58
_shape
= TensorShape.Create(array, lengths, strides);
70
_shape
= TensorShape.Create(array, start, lengths, strides);
80
_shape
= TensorShape.Create(ref reference, span.Length, pinned: false);
92
_shape
= TensorShape.Create(ref reference, span.Length, lengths, strides, pinned: false);
102
_shape
= TensorShape.Create(array);
114
_shape
= TensorShape.Create(array, start, lengths, strides, out nint linearOffset);
124
_shape
= TensorShape.Create(data, dataLength);
137
_shape
= TensorShape.Create(data, dataLength, lengths, strides);
143
_shape
= TensorShape.Create(ref data, dataLength, lengths, strides, pinned);
150
_shape
= shape;
56 references to _shape
System.Numerics.Tensors (56)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (1)
422
if (TensorShape.AreCompatible(destination.
_shape
, _shape, false))
System\Numerics\Tensors\netcore\Tensor.cs (9)
438
Span<T> span = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.
_shape
.LinearLength);
461
Span<T> span = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.
_shape
.LinearLength);
1548
TensorSpan<T> output = new TensorSpan<T>(ref tensor._reference, tensor.
_shape
.LinearLength, newLengths, strides, tensor.IsPinned);
1681
Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.
_shape
.LinearLength);
1776
&& tensor.
_shape
.LinearLength == other._shape.LinearLength
1778
&& MemoryMarshal.CreateReadOnlySpan(in tensor.GetPinnableReference(), (int)tensor.
_shape
.LinearLength).SequenceEqual(MemoryMarshal.CreateReadOnlySpan(in other.GetPinnableReference(), (int)other._shape.LinearLength));
1998
TensorSpan<T> output = new TensorSpan<T>(ref tensor._reference, tensor.
_shape
.LinearLength, lengths[..rank], strides[..rank], tensor.IsPinned);
2314
if (!TensorShape.AreCompatible(destination.
_shape
, tensor._shape, false))
2391
TensorSpan<T> output = new TensorSpan<T>(ref tensor._reference, tensor.
_shape
.LinearLength, newLengths, newStrides, tensor.IsPinned);
System\Numerics\Tensors\netcore\TensorDimensionSpan_1.cs (1)
51
nint linearOffset = _tensor.
_shape
.GetLinearOffset(index, _dimension);
System\Numerics\Tensors\netcore\TensorOperation.cs (24)
20
linearOffset = x.
_shape
.AdjustToNextIndex(x.
_shape
, linearOffset, indexes);
96
linearOffset = destination.
_shape
.AdjustToNextIndex(destination.
_shape
, linearOffset, indexes);
114
xLinearOffset = x._shape.AdjustToNextIndex(destination.
_shape
, xLinearOffset, xIndexes);
115
destinationLinearOffset = destination.
_shape
.AdjustToNextIndex(destination.
_shape
, destinationLinearOffset, destinationIndexes);
138
nint destinationLinearOffset = destination.
_shape
.LinearLength;
142
xLinearOffset = x._shape.AdjustToNextIndex(destination.
_shape
, xLinearOffset, xIndexes);
143
destinationLinearOffset = destination.
_shape
.AdjustToPreviousIndex(destination.
_shape
, destinationLinearOffset, destinationIndexes);
203
xLinearOffset = x._shape.AdjustToNextIndex(destination.
_shape
, xLinearOffset, xIndexes);
204
yLinearOffset = y._shape.AdjustToNextIndex(destination.
_shape
, yLinearOffset, yIndexes);
205
destinationLinearOffset = destination.
_shape
.AdjustToNextIndex(destination.
_shape
, destinationLinearOffset, destinationIndexes);
263
xLinearOffset = x._shape.AdjustToNextIndex(destination.
_shape
, xLinearOffset, xIndexes);
264
destinationLinearOffset = destination.
_shape
.AdjustToNextIndex(destination.
_shape
, destinationLinearOffset, destinationIndexes);
285
xLinearOffset = y._shape.AdjustToNextIndex(destination.
_shape
, xLinearOffset, xIndexes);
286
destinationLinearOffset = destination.
_shape
.AdjustToNextIndex(destination.
_shape
, destinationLinearOffset, destinationIndexes);
338
if (!TensorShape.AreCompatible(destination.
_shape
, x._shape, false))
347
if (TensorShape.AreCompatible(destination.
_shape
, x._shape, false))
349
if (TensorShape.AreCompatible(destination.
_shape
, y._shape, false))
System\Numerics\Tensors\netcore\TensorSpan_1.cs (21)
156
get => ref Unsafe.Add(ref _reference,
_shape
.GetLinearOffset<TensorShape.GetOffsetAndLengthForNInt, nint>(indexes));
162
get => ref Unsafe.Add(ref _reference,
_shape
.GetLinearOffset<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(indexes));
173
public nint FlattenedLength =>
_shape
.FlattenedLength;
176
public bool HasAnyDenseDimensions =>
_shape
.HasAnyDenseDimensions;
179
public bool IsDense =>
_shape
.IsDense;
182
public bool IsEmpty =>
_shape
.IsEmpty;
185
public bool IsPinned =>
_shape
.IsPinned;
189
public ReadOnlySpan<nint> Lengths =>
_shape
.Lengths;
196
public ReadOnlySpan<nint> Strides =>
_shape
.Strides;
201
&& left.
_shape
== right.
_shape
;
215
new ReadOnlyTensorSpan<T>(ref tensor._reference, tensor.
_shape
);
218
public ReadOnlyTensorSpan<T> AsReadOnlyTensorSpan() => new ReadOnlyTensorSpan<T>(ref _reference, in
_shape
);
277
if (
_shape
.FlattenedLength != 0) ret = ref _reference;
284
TensorShape shape =
_shape
.Slice<TensorShape.GetOffsetAndLengthForNInt, nint>(startIndexes, out nint linearOffset);
294
TensorShape shape =
_shape
.Slice<TensorShape.GetOffsetAndLengthForNIndex, NIndex>(startIndexes, out nint linearOffset);
304
TensorShape shape =
_shape
.Slice<TensorShape.GetOffsetAndLengthForNRange, NRange>(ranges, out nint linearOffset);
312
public override string ToString() => $"System.Numerics.Tensors.TensorSpan<{typeof(T).Name}>[{
_shape
}]";
428
if (_itemsEnumerated == _span.
_shape
.FlattenedLength)
433
_linearOffset = _span.
_shape
.AdjustToNextIndex(_span.
_shape
, _linearOffset, _indexes);