6 writes to _shape
System.Numerics.Tensors (6)
System\Numerics\Tensors\netcore\TensorSpan.cs (6)
106_shape = new TensorShape(array.Length - start, lengths, strides); 137_shape = new TensorShape(span.Length, lengths, strides); 201_shape = new TensorShape(array.Length - startOffset, lengths, strides); 248_shape = new TensorShape(array.Length, lengths, strides); 303_shape = new TensorShape(dataLength, lengths, strides); 313_shape = new TensorShape(memoryLength, lengths, strides);
75 references to _shape
System.Numerics.Tensors (75)
System\Numerics\Tensors\netcore\Tensor.Factory.cs (3)
191Span<T> span = MemoryMarshal.CreateSpan<T>(ref destination._reference, (int)destination._shape._memoryLength); 193GaussianDistribution<T>(span, destination._shape._memoryLength, random ?? Random.Shared); 208Span<T> span = MemoryMarshal.CreateSpan<T>(ref destination._reference, (int)destination._shape._memoryLength);
System\Numerics\Tensors\netcore\TensorExtensions.cs (44)
149return new TensorSpan<T>(ref input._reference, shape, input.Strides, input._shape._memoryLength); 175TensorSpan<T> output = new TensorSpan<T>(ref input._reference, shape, strides, input._shape._memoryLength); 765Span<T> srcSpan = MemoryMarshal.CreateSpan(ref tensor._reference, (int)tensor._shape._memoryLength); 766Span<bool> filterSpan = MemoryMarshal.CreateSpan(ref filter._reference, (int)tensor._shape._memoryLength); 793Span<T> dstSpan = MemoryMarshal.CreateSpan(ref tensor._reference, (int)tensor._shape._memoryLength); 794Span<bool> filterSpan = MemoryMarshal.CreateSpan(ref filter._reference, (int)tensor._shape._memoryLength); 2858TensorSpan<T> output = new TensorSpan<T>(ref tensor._reference, arrLengths, strides, tensor._shape._memoryLength); 2963Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination._shape._memoryLength); 2964if (destination._shape._memoryLength > tensor._values.Length) 2967TensorSpanHelpers.Memmove(ospan, span, destination._shape._memoryLength); 2978ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref tensor._reference, (int)tensor._shape._memoryLength); 2979Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination._shape._memoryLength); 2980if (destination._shape._memoryLength > tensor._shape._memoryLength) 2981TensorSpanHelpers.Memmove(ospan, span, tensor._shape._memoryLength); 2983TensorSpanHelpers.Memmove(ospan, span, destination._shape._memoryLength); 2995Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination._shape._memoryLength); 2996if (destination._shape._memoryLength > tensor._shape._memoryLength) 2999TensorSpanHelpers.Memmove(ospan, span, destination._shape._memoryLength); 3053Span<T> outputSpan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination._shape._memoryLength); 3122&& tensor._shape._memoryLength == other._shape._memoryLength 3124&& MemoryMarshal.CreateReadOnlySpan(in tensor.GetPinnableReference(), (int)tensor._shape._memoryLength).SequenceEqual(MemoryMarshal.CreateReadOnlySpan(in other.GetPinnableReference(), (int)other._shape._memoryLength)); 3372return new TensorSpan<T>(ref tensor._reference, lengths, strides, tensor._shape._memoryLength); 3745return new TensorSpan<T>(ref tensor._reference, lengths, strides, tensor._shape._memoryLength); 4705Span<T> values = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination._shape._memoryLength); 6017Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination._shape._memoryLength); 6258if (destination._shape._memoryLength < x._shape._memoryLength) 6262Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination._shape._memoryLength); 6289if (destination._shape._memoryLength < x._shape._memoryLength) 6293Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination._shape._memoryLength); 6320if (destination._shape._memoryLength < x._shape._memoryLength) 6324Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination._shape._memoryLength); 6370if (destination._shape._memoryLength < x._shape._memoryLength) 6374Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination._shape._memoryLength); 6397if (destination._shape._memoryLength < x._shape._memoryLength) 6401Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination._shape._memoryLength); 6424if (destination._shape._memoryLength < x._shape._memoryLength) 6428Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination._shape._memoryLength); 6921if (destination._shape._memoryLength < input._shape.FlattenedLength) 6934destinationSpan = MemoryMarshal.CreateSpan(ref slicedDestination._reference, (int)slicedDestination._shape.FlattenedLength); 6974if (destination._shape._memoryLength < input._shape.FlattenedLength) 7026if (destination._shape._memoryLength < input._shape.FlattenedLength) 7038destinationSpan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination._shape._memoryLength); 7088Span<T> ospan = MemoryMarshal.CreateSpan(ref slicedDestination._reference, (int)slicedDestination._shape._memoryLength);
System\Numerics\Tensors\netcore\TensorSpan.cs (28)
334if (index >= _shape._memoryLength || index < 0) 359if (index >= _shape._memoryLength || index < 0) 390public nint FlattenedLength => _shape.FlattenedLength; 396public bool IsEmpty => _shape.IsEmpty; 402public ReadOnlySpan<nint> Lengths => _shape.Lengths; 413public ReadOnlySpan<nint> Strides => _shape.Strides; 426left._shape.FlattenedLength == right._shape.FlattenedLength && 428left._shape.Lengths.SequenceEqual(right._shape.Lengths) && 429left._shape.Strides.SequenceEqual(right._shape.Strides) && 513if (_shape.FlattenedLength != 0) ret = ref _reference; 538while (clearedValues < _shape.FlattenedLength) 541TensorSpanHelpers.AdjustIndexes(Rank - 2, 1, curIndexes, _shape.Lengths); 552MemoryMarshal.CreateSpan<T>(ref _reference, (int)_shape._memoryLength).Fill(value); 673new ReadOnlyTensorSpan<T>(ref span._reference, span._shape.Lengths, span._shape.Strides, span._shape._memoryLength); 679public override string ToString() => $"System.Numerics.Tensors.TensorSpan<{typeof(T).Name}>[{_shape.FlattenedLength}]"; 767if ((index >= _shape._memoryLength || index < 0) && flattenedLength != 0) 770toReturn = new TensorSpan<T>(ref Unsafe.Add(ref _reference, index), lengths, _shape.Strides, _shape._memoryLength - index); 787if (destination.Length <= _shape.FlattenedLength) 801if (destination.Length < _shape.FlattenedLength) 804if (_shape.FlattenedLength == 0) 822while (copiedValues < _shape.FlattenedLength) 825TensorSpanHelpers.AdjustIndexes(Rank - 2, 1, curIndexes, _shape.Lengths);