--dynamic_dims
Description
Sets dynamic dimension profiles in ND format. Applies to the scenario where the dimensions for inference are unfixed.
See Also
This option must be used in conjunction with --input_shape and is mutually exclusive with --dynamic_batch_size, --dynamic_image_size, and --insert_op_conf.
Arguments
Argument: for example, "dim1,dim2,dim3;dim4,dim5,dim6;dim7,dim8,dim9".
Format: Enclose the whole argument in double quotation marks (""), and separate the dimension sizes by a semicolon (;). The dimension size values match the -1 placeholders in the --input_shape argument with ordering preserved, and the number of -1 placeholders equals the number of dimension sizes of each profile.
Restrictions: The dynamic dimension feature allows a shape up to 4-dimensional. The number of dimension size profiles per dimension has a value range (1, 100]. 3–4 dimension size profiles per dimension are recommended.
Suggestions and Benefits
None
Examples
- If the network model has only one input:
The dimension size values match the -1 placeholders in the --input_shape argument with ordering preserved, and the number of -1 placeholders equals the number of dimension sizes of each profile. For example:
Assume that values of the AOE options are as follows:
--input_shape="data:1,-1" --dynamic_dims="4;8;16;64"
The shape of the data operator supported by the AOE during model tuning is (1, 4), (1, 8), (1, 16), and (1, 64).
Assume that values of the AOE options are as follows:
--input_shape="data:1,-1,-1" --dynamic_dims="1,2;3,4;5,6;7,8"
The shape of the data operator supported by the AOE during model tuning is (1, 1, 2), (1, 3, 4), (1, 5, 6), and (1, 7, 8).
- If the network model has multiple inputs:
The dimension size values match the -1 placeholders in the argument with ordering preserved, and the number of -1 placeholders equals the number of dimension sizes of each profile. Assume that a network model has three inputs: data (1, 1, 40, T), label (1, T) and mask (T, T), where T indicates a dynamic dimension. The configuration example is as follows:
--input_shape="data:1,1,40,-1;label:1,-1;mask:-1,-1" --dynamic_dims="20,20,1,1;40,40,2,2;80,60,4,4" --input_format=ND
When the AOE tunes a model, the supported input dims combinations are as follows:
Profile 0: data(1,1,40,20)+label(1,20)+mask(1,1)
Profile 1: data(1,1,40,40)+label(1,40)+mask(2,2)
Profile 2: data(1,1,40,80)+label(1,60)+mask(4,4)