Exemplo n.º 1
0
        public static Tensor <T> operator +(Tensor <T> left, Tensor <T> right)
        {
            if (left.Shape != right.Shape)
            {
                throw new ShapeMismatchException(nameof(right));
            }

            T[] result = SimdOps <T> .Add(left.InternalArray, right.InternalArray);

            return(FromRef(left.Shape, result));
        }
Exemplo n.º 2
0
        public static Tensor <T> operator +(T left, Tensor <T> right)
        {
            T[] result = SimdOps <T> .Add(right.InternalArray, left);

            return(FromRef(right.Shape, result));
        }
Exemplo n.º 3
0
        public static Tensor <T> operator ++(Tensor <T> tensor)
        {
            T[] result = SimdOps <T> .Add(tensor.InternalArray, One);

            return(FromRef(tensor.Shape, result));
        }
Exemplo n.º 4
0
        public static Tensor <T> operator &(Tensor <T> left, T right)
        {
            T[] result = SimdOps <T> .Add(left.InternalArray, right);

            return(FromRef(left.Shape, result));
        }