Exemple #1
0
        public static Tensor NewFromDTO(TensorDTO dto)
        {
            var result = new Tensor(dto.ShapeX, dto.ShapeY);

            result.CopyFrom(dto.Buffer);
            return(result);
        }
Exemple #2
0
 public bool IsSame(TensorDTO rhs)
 {
     if (ShapeX != rhs.ShapeX)
     {
         return(false);
     }
     if (ShapeY != rhs.ShapeY)
     {
         return(false);
     }
     for (var i = 0; i < Buffer.Length; i++)
     {
         if (Buffer[i] != rhs.Buffer[i])
         {
             return(false);
         }
     }
     return(true);
 }