set_inputs_align_attrs

Applicable Products

Product

Supported

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

x

Atlas inference products

x

Atlas training products

x

Function Description

Sets the attribute of input alignment in FlowGraph.

Prototype

1
set_inputs_align_attrs(self, align_max_cache_num: int, align_timeout: int, dropout_when_not_align: bool = False)

Parameters

Parameter

Data Type

Value Description

align_max_cache_num

int

Maximum number of caches for data alignment. The default value is 0, indicating that data alignment is disabled. A value greater than 0 indicates that data alignment is enabled. The maximum value is 1024.

Each cache represents a set of inputs.

align_timeout

int

Wait timeout for aligning each group of data, in ms.

The value -1 indicates that no timeout ever occurs. The value must be greater than 0 and less than or equal to 600 x 1000 ms (10 minutes).

dropout_when_not_align

bool

Whether to drop the unaligned data after a timeout occurs or the maximum number of caches is exceeded.

  • True: yes
  • False: no

The default value is False.

Returns

None

Examples

1
2
3
import dataflow as df
graph = df.FlowGraph(...)
graph.set_inputs_align_attrs(256, 600 * 1000, False)

Constraints

None