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; }
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. }