/// <inheritdoc/>
        public virtual Tensor Alloc(TensorShape shape, AllocScope scope, DataType dataType)
        {
            Profiler.BeginSample("Barracuda.SizeAllocator.Alloc");
            var name = "untitled";

            for (int i = 0; i < m_AllocatedBuffers.Count; ++i)
            {
                var entry = m_AllocatedBuffers[i];
                if (entry.size >= shape.length && entry.dataType == dataType && entry.free)
                {
                    entry.free            = false;
                    m_AllocatedBuffers[i] = entry;

                    ITensorData buffer = entry.tensorData;
                    buffer?.Reserve(shape.length);

                    var tensor = AllocTensorInternal(dataType, shape, buffer);
                    tensor.name = name;

                    m_BusyTensors.Add(tensor, tensor.tensorOnDevice);
                    AddRef(tensor.tensorOnDevice);

                    Profiler.EndSample();
                    return(tensor);
                }
            }

            ++m_NumAllocatedBufferSinceCleanup;

            var newTensor = AllocTensorInternal(dataType, shape, null);

            newTensor.name = name;
            m_BusyTensors.Add(newTensor, newTensor.tensorOnDevice);
            AddRef(newTensor.tensorOnDevice);

            Profiler.EndSample();
            return(newTensor);
        }