/// <inheritdoc />
        public override void Fill(INDArray filler, INDArray arrayToFill, long[] sourceBeginIndices, long[] sourceEndIndices, long[] destinationBeginIndices, long[] destinationEndIndices)
        {
            CudaSigmaDiffDataBuffer <float> fillerData      = (CudaSigmaDiffDataBuffer <float>)InternaliseArray(filler).Data;
            CudaSigmaDiffDataBuffer <float> arrayToFillData = (CudaSigmaDiffDataBuffer <float>)InternaliseArray(arrayToFill).Data;

            int sourceOffset      = (int)NDArrayUtils.GetFlatIndex(filler.Shape, filler.Strides, sourceBeginIndices);
            int sourceLength      = (int)NDArrayUtils.GetFlatIndex(filler.Shape, filler.Strides, sourceEndIndices) - sourceOffset + 1;                     // +1 because end is inclusive
            int destinationOffset = (int)NDArrayUtils.GetFlatIndex(arrayToFill.Shape, arrayToFill.Strides, destinationBeginIndices);
            int destinationLength = (int)NDArrayUtils.GetFlatIndex(arrayToFill.Shape, arrayToFill.Strides, destinationEndIndices) - destinationOffset + 1; // same here

            if (sourceLength < 0)
            {
                throw new ArgumentOutOfRangeException($"Source begin indices must be smaller than source end indices, but source length was {sourceLength}.");
            }
            if (destinationLength < 0)
            {
                throw new ArgumentOutOfRangeException($"Destination begin indices must be smaller than destination end indices, but destination length was {destinationLength}.");
            }
            if (sourceLength != destinationLength)
            {
                throw new ArgumentException($"Source and destination indices length must batch, but source length was {sourceLength} and destination legnth was {destinationLength}.");
            }

            Array.Copy(fillerData.Data, sourceOffset, arrayToFillData.Data, destinationOffset, sourceLength);
            arrayToFillData.CopyFromHostToDevice();
        }
        /// <inheritdoc />
        public override void Fill(INDArray filler, INDArray arrayToFill)
        {
            CudaSigmaDiffDataBuffer <float> fillerData      = (CudaSigmaDiffDataBuffer <float>)InternaliseArray(filler).Data;
            CudaSigmaDiffDataBuffer <float> arrayToFillData = (CudaSigmaDiffDataBuffer <float>)InternaliseArray(arrayToFill).Data;

            arrayToFillData.SetValues(fillerData.Data, fillerData.Offset, 0, Math.Min(arrayToFill.Length, filler.Length));
            arrayToFillData.CopyFromHostToDevice();
        }
        /// <inheritdoc />
        public override void Fill <TOther>(TOther value, INDArray arrayToFill)
        {
            CudaSigmaDiffDataBuffer <float> arrayToFillData = (CudaSigmaDiffDataBuffer <float>)InternaliseArray(arrayToFill).Data;
            float floatValue = (float)System.Convert.ChangeType(value, typeof(float));

            for (int i = 0; i < arrayToFillData.Length; i++)
            {
                arrayToFillData.Data.SetValue(floatValue, i);
            }

            arrayToFillData.CopyFromHostToDevice();
        }
        /// <inheritdoc />
        public override void Fill <T>(T[] filler, INDArray arrayToFill, long[] destinationBeginIndices, long[] destinationEndIndices)
        {
            CudaSigmaDiffDataBuffer <float> arrayToFillData = (CudaSigmaDiffDataBuffer <float>)InternaliseArray(arrayToFill).Data;

            int destinationOffset = (int)NDArrayUtils.GetFlatIndex(arrayToFill.Shape, arrayToFill.Strides, destinationBeginIndices);
            int destinationLength = (int)NDArrayUtils.GetFlatIndex(arrayToFill.Shape, arrayToFill.Strides, destinationEndIndices) - destinationOffset + 1;             // +1 because end is inclusive

            if (destinationLength < 0)
            {
                throw new ArgumentOutOfRangeException($"Destination begin indices must be smaller than destination end indices, but destination length was {destinationLength}.");
            }

            Array.Copy(filler, 0, arrayToFillData.Data, destinationOffset, destinationLength);
            arrayToFillData.CopyFromHostToDevice();
        }