Skip to content

ParallelCompositeProcessor

Vector processor that composes multiple vector processors in parallel

Notes
  • The vector processors are not called concurrently, but each one gets a copy of the vector and the resulting vectors are combined
  • The vector processors are composed horizontally, i.e., in parallel

Implements the VectorProcessor protocol.

PARAMETER DESCRIPTION
vector_processors

Vector processors

TYPE: list[VectorProcessor]

from_config classmethod

Creates a parallel composite processor from the configuration.

PARAMETER DESCRIPTION
config

Configuration

TYPE: ParallelCompositeProcessorConfig

RETURNS DESCRIPTION
ParallelCompositeProcessor

Parallel composite processor

__call__

Processes the vector with each vector processor.

PARAMETER DESCRIPTION
vector

Vector

TYPE: Vector

RETURNS DESCRIPTION
Vector

Vector


ParallelCompositeProcessorConfig

Bases: pydantic.BaseModel

Configuration for the from_config class method of ParallelCompositeProcessor

Example

You can create the configuration from a config file.

config.yaml
package: 'aviary'
name: 'ParallelCompositeProcessor'
config:
  vector_processor_configs:
    - ...
    ...
ATTRIBUTE DESCRIPTION
vector_processor_configs

Configurations of the vector processors

TYPE: list[VectorProcessorConfig]