예제 #1
0
            public Tensor GetBufferedBatchTensor()
            {
                _position = 0;
                var tensor = TensorFlowUtils.CastDataAndReturnAsTensor(_denseData, _tfShape);

                _bufferedData = new T[_bufferedDataSize];
                return(tensor);
            }
예제 #2
0
            public Tensor GetTensor()
            {
                var scalar = default(T);

                _srcgetter(ref scalar);
                var tensor = TensorFlowUtils.CastDataAndReturnAsTensor(scalar);

                return(tensor);
            }
예제 #3
0
            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);
            }