コード例 #1
0
ファイル: Tensor.cs プロジェクト: faruknane/PerformanceWork
        public Tensor(Shape s, TensorBase tbase)
        {
            if (s.TotalSize > tbase.Length)
            {
                throw new Exception("Can't create a tensor larger than its base!");
            }

            this.Shape  = s;
            this.Config = tbase.Config;
            this.Base   = tbase;
        }
コード例 #2
0
ファイル: Tensor.cs プロジェクト: faruknane/PerformanceWork
 protected Tensor(Shape s, void *ptr, TensorConfig devconfig)
 {
     this.Shape  = s;
     this.Config = devconfig;
     this.Base   = new TensorBase(ptr, s.TotalSize, true, devconfig);//means that the array wont be returned to the pool.
 }