public Tensor GetBufferedBatchTensor() { _position = 0; var tensor = TensorFlowUtils.CastDataAndReturnAsTensor(_denseData, _tfShape); _bufferedData = new T[_bufferedDataSize]; return(tensor); }
public Tensor GetTensor() { var scalar = default(T); _srcgetter(ref scalar); var tensor = TensorFlowUtils.CastDataAndReturnAsTensor(scalar); return(tensor); }
public Tensor GetTensor() { _srcgetter(ref _vBuffer); // _denseData.Length can be greater than _vBuffer.Length sometime after // Utils.EnsureSize is executed. Use _vBuffer.Length to access the elements in _denseData. // This is done to reduce memory allocation every time tensor is created. _denseData = new T[_vBuffer.Length]; _vBuffer.CopyTo(_denseData); var tensor = TensorFlowUtils.CastDataAndReturnAsTensor(_denseData, _tfShape); return(tensor); }