# jina.drivers.encode¶

class jina.drivers.encode.BaseEncodeDriver(executor=None, method='encode', *args, **kwargs)[source]

Drivers inherited from this Driver will bind encode() by default

Initialize a BaseExecutableDriver

Parameters
class jina.drivers.encode.EncodeDriver(batch_size=None, *args, **kwargs)[source]

Extract the content from documents and call executor and do encoding

Extract from different documents. :type batch_size: Optional[int] :param batch_size: number of documents to be used simultaniously in the encoder :meth:apply_all. It is specially useful when the same EncoderExecutor can be used for documents of different granularities

(chunks, chunks of chunks …)

Warning

• This parameter was added to cover the case where root documents had very few chunks, and the encoder executor could

then only process them in batches of the chunk size of each document, which did not lead to the full use of batching capabilities of the powerful Executors

class CacheDocumentSet(capacity=None, *args, **kwargs)[source]

Bases: object

Helper class to accumulate documents from differents document Set in a single DocumentSet to help guarantee that the encoder driver can consume documents in fixed batch sizes to allow the EncoderExecutors to leverage its batching abilities.

It is useful to have batching even when chunks are involved

property available_capacity
cache(docs)[source]
get()[source]