set_inputs_align_attrs

Applicability

Product

Supported

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

x

Atlas inference product

x

Atlas training product

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

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 means no timeout limit. The value must be greater than 0 and less than or equal to 600 × 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