nvalchemi.dynamics.ResizableSink#

class nvalchemi.dynamics.ResizableSink(*args, **kwargs)[source]#

Sink that a consumer can grow to the capacity it needs.

A DataSink fixes its capacity at construction. A sink that also satisfies this protocol can be grown with resize. A consumer that knows how many frames it is about to write, such as the on-policy distillation segment loop, calls resize first instead of rejecting a sink that is too small.

Examples

>>> from nvalchemi.dynamics import HostMemory, ResizableSink
>>> isinstance(HostMemory(capacity=1), ResizableSink)
False
resize(capacity)[source]#

Grow the sink so it holds at least capacity frames.

Parameters:

capacity (int)

Return type:

None