torch.tx.BufferPool.acquire
bufferPool.acquire(shape: readonly number[], dtype: DType, createFn: (shape: readonly number[], dtype: DType) => AnyTensor): AnyTensorAcquire a buffer with the given shape and dtype.
If a matching buffer is available in the pool, it's returned. Otherwise, a new buffer is created.
Parameters
shapereadonly number[]- The desired buffer shape
dtypeDType- The desired data type
Returns
AnyTensor– A tensor buffer with the specified shape and dtype