Skip to content

Commit

Permalink
Fix some typos (intput, dics_intput, etc.) (PaddlePaddle#61786)
Browse files Browse the repository at this point in the history
  • Loading branch information
co63oc committed Feb 21, 2024
1 parent 5602e4b commit 7a6ba34
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 38 deletions.
10 changes: 5 additions & 5 deletions test/auto_parallel/spmd_rules/test_reshape_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def test_reshape_infer_backward(self):
infered_output_dist_attrs[0].dims_mapping, [-1, -1, 0, -1, 1]
)

# shape: [6, 12, 48, 24] --> [6, 12, 48, 24] (intput --> output)
# shape: [6, 12, 48, 24] --> [6, 12, 48, 24] (input --> output)
# dims_mapping: [-1, -1, 0, 1] --> [-1, -1, 0, 1], [-1, -1, 0, 1] (output --> input, output)
self.output_dist_tensor_spec.shape = [6, 12, 48, 24]
self.output_dist_tensor_spec.set_dims_mapping([-1, -1, 0, 1])
Expand All @@ -426,7 +426,7 @@ def test_reshape_infer_backward(self):
infered_output_dist_attrs[0].dims_mapping, [-1, -1, 0, 1]
)

# shape: [6, 12, 48, 24] --> [72, 3, 16, 24] (intput --> output)
# shape: [6, 12, 48, 24] --> [72, 3, 16, 24] (input --> output)
# dims_mapping: [0, 1, -1, -1] --> [0, -1, 1, -1], [0, 1, -1, -1] (output --> input, output)
self.output_dist_tensor_spec.shape = [72, 3, 16, 24]
self.output_dist_tensor_spec.set_dims_mapping([0, 1, -1, -1])
Expand All @@ -445,7 +445,7 @@ def test_reshape_infer_backward(self):
infered_output_dist_attrs[0].dims_mapping, [0, 1, -1, -1]
)

# shape: [6, 12, 48, 24] --> [72, 3, 16, 24] (intput --> output)
# shape: [6, 12, 48, 24] --> [72, 3, 16, 24] (input --> output)
# dims_mapping: [1, -1, -1, -1] --> [1, -1, -1, -1], [1, -1, -1, -1] (output --> input, output)
self.output_dist_tensor_spec.shape = [72, 3, 16, 24]
self.output_dist_tensor_spec.set_dims_mapping([1, -1, -1, -1])
Expand All @@ -464,7 +464,7 @@ def test_reshape_infer_backward(self):
infered_output_dist_attrs[0].dims_mapping, [1, -1, -1, -1]
)

# shape: [6, 12, 48, 24] --> [1, 72, 48, 4, 6] (intput --> output)
# shape: [6, 12, 48, 24] --> [1, 72, 48, 4, 6] (input --> output)
# dims_mapping: [-1, 0, -1, -1, 1] --> [0, -1, -1, -1], [-1, 0, -1, -1, -1] (output --> input, output)
self.output_dist_tensor_spec.shape = [1, 72, 48, 4, 6]
self.output_dist_tensor_spec.set_dims_mapping([-1, 0, -1, -1, 1])
Expand All @@ -483,7 +483,7 @@ def test_reshape_infer_backward(self):
infered_output_dist_attrs[0].dims_mapping, [-1, 0, -1, -1, -1]
)

# shape: [6, 12, 48, 24] --> [3, 24, 6, 8, 24] (intput --> output)
# shape: [6, 12, 48, 24] --> [3, 24, 6, 8, 24] (input --> output)
# dims_mapping: [-1, 1, -1, -1, 0] --> [-1, -1, -1, 0], [-1, -1, -1, -1, 0] (output --> input, output)
self.output_dist_tensor_spec.shape = [3, 24, 6, 8, 24]
self.output_dist_tensor_spec.set_dims_mapping([-1, 1, -1, -1, 0])
Expand Down
10 changes: 5 additions & 5 deletions test/ir/inference/test_trt_convert_batch_norm.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def generate_MomentumTensor(attrs: list[dict[str, Any]], batch):
},
{},
]
dics_intput = [
dics_input = [
{
"X": ["batch_norm_input"],
"Bias": ["Bias"],
Expand All @@ -89,7 +89,7 @@ def generate_MomentumTensor(attrs: list[dict[str, Any]], batch):
"Variance": ["Variance"],
},
]
dics_intputs = [
dics_inputs = [
{
"Bias": TensorConfig(
data_gen=partial(generate_bias, dics, batch)
Expand Down Expand Up @@ -129,7 +129,7 @@ def generate_MomentumTensor(attrs: list[dict[str, Any]], batch):
ops_config = [
{
"op_type": "batch_norm",
"op_inputs": dics_intput[num_input],
"op_inputs": dics_input[num_input],
"op_outputs": {
"Y": ["batch_norm_out"],
"MeanOut": ["Mean"],
Expand All @@ -143,14 +143,14 @@ def generate_MomentumTensor(attrs: list[dict[str, Any]], batch):
ops = self.generate_op_config(ops_config)
program_config = ProgramConfig(
ops=ops,
weights=dics_intputs[num_input],
weights=dics_inputs[num_input],
inputs={
"batch_norm_input": TensorConfig(
data_gen=partial(generate_input1, dics, batch)
)
},
outputs=["batch_norm_out"],
no_cast_list=list(dics_intputs[num_input].keys()),
no_cast_list=list(dics_inputs[num_input].keys()),
)

yield program_config
Expand Down
4 changes: 2 additions & 2 deletions test/ir/inference/test_trt_convert_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def generate_weight1(attrs: List[Dict[str, Any]]):
self.num_input = num_input
self.dims = dims
dics = [{"axis": axis}, {}]
dics_intput = [
dics_input = [
{
"X": [
"concat_input1",
Expand Down Expand Up @@ -138,7 +138,7 @@ def generate_weight1(attrs: List[Dict[str, Any]]):
ops_config = [
{
"op_type": "concat",
"op_inputs": dics_intput[num_input],
"op_inputs": dics_input[num_input],
"op_outputs": {"Out": ["concat_output"]},
"op_attrs": dics[0],
}
Expand Down
4 changes: 2 additions & 2 deletions test/ir/inference/test_trt_convert_expand_as_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def generate_input1(attrs: List[Dict[str, Any]]):
},
]
self.dims = dims
dics_intput = [
dics_input = [
{"X": ["expand_v2_input"], "Y": ["shapeT1_data"]},
]
ops_config = [
Expand All @@ -209,7 +209,7 @@ def generate_input1(attrs: List[Dict[str, Any]]):
},
{
"op_type": "expand_as_v2",
"op_inputs": dics_intput[0],
"op_inputs": dics_input[0],
"op_outputs": {"Out": ["expand_v2_out"]},
"op_attrs": dics[0],
},
Expand Down
12 changes: 6 additions & 6 deletions test/ir/inference/test_trt_convert_expand_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ def generate_shapeT2_data(attrs: List[Dict[str, Any]]):
},
]
self.dims = dims
dics_intput = [{"X": ["expand_v2_input"]}]
dics_input = [{"X": ["expand_v2_input"]}]

ops_config = [
{
"op_type": "expand_v2",
"op_inputs": dics_intput[0],
"op_inputs": dics_input[0],
"op_outputs": {"Out": ["expand_v2_out"]},
"op_attrs": dics[0],
}
Expand Down Expand Up @@ -199,7 +199,7 @@ def generate_input1(attrs: List[Dict[str, Any]]):
},
]
self.dims = dims
dics_intput = [
dics_input = [
{"X": ["expand_v2_input"], "Shape": ["shapeT1_data"]},
]
ops_config = [
Expand All @@ -215,7 +215,7 @@ def generate_input1(attrs: List[Dict[str, Any]]):
},
{
"op_type": "expand_v2",
"op_inputs": dics_intput[0],
"op_inputs": dics_input[0],
"op_outputs": {"Out": ["expand_v2_out"]},
"op_attrs": dics[0],
},
Expand Down Expand Up @@ -291,7 +291,7 @@ def generate_input1(attrs: List[Dict[str, Any]]):
},
]
self.dims = dims
dics_intput = [
dics_input = [
{
"X": ["expand_v2_input"],
"expand_shapes_tensor": [
Expand Down Expand Up @@ -345,7 +345,7 @@ def generate_input1(attrs: List[Dict[str, Any]]):
},
{
"op_type": "expand_v2",
"op_inputs": dics_intput[0],
"op_inputs": dics_input[0],
"op_outputs": {"Out": ["expand_v2_out"]},
"op_attrs": dics[0],
},
Expand Down
4 changes: 2 additions & 2 deletions test/ir/inference/test_trt_convert_fill_any_like.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ def generate_shapeT2_data(attrs: List[Dict[str, Any]]):
]
self.dims = dims
self.dtype = dtype
dics_intput = [{"X": ["fill_any_like_input"]}]
dics_input = [{"X": ["fill_any_like_input"]}]

ops_config = [
{
"op_type": "fill_any_like",
"op_inputs": dics_intput[0],
"op_inputs": dics_input[0],
"op_outputs": {"Out": ["fill_any_like_out"]},
"op_attrs": dics[0],
}
Expand Down
8 changes: 4 additions & 4 deletions test/ir/inference/test_trt_convert_scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ def generate_weight1(attrs: list[dict[str, Any]], is_int):
{},
]

dics_intput = [
dics_input = [
{
"X": ["scale_input"],
"ScaleTensor": ["ScaleTensor"],
},
{"X": ["scale_input"]},
]
dics_intputs = [
dics_inputs = [
{
"ScaleTensor": TensorConfig(
data_gen=partial(
Expand All @@ -104,15 +104,15 @@ def generate_weight1(attrs: list[dict[str, Any]], is_int):
ops_config = [
{
"op_type": "scale",
"op_inputs": dics_intput[num_input],
"op_inputs": dics_input[num_input],
"op_outputs": {"Out": ["scale_out"]},
"op_attrs": dics[0],
}
]
ops = self.generate_op_config(ops_config)
program_config = ProgramConfig(
ops=ops,
weights=dics_intputs[num_input],
weights=dics_inputs[num_input],
inputs={
"scale_input": TensorConfig(
data_gen=partial(
Expand Down
12 changes: 6 additions & 6 deletions test/ir/inference/test_trt_convert_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def generate_SectionsTensorList2(attrs: List[Dict[str, Any]]):
{},
]

dics_intput = [
dics_input = [
{
"X": ["split_input"],
"AxisTensor": ["AxisTensor"],
Expand All @@ -142,7 +142,7 @@ def generate_SectionsTensorList2(attrs: List[Dict[str, Any]]):
},
{"X": ["split_input"]},
]
dics_intputs = [
dics_inputs = [
{
"AxisTensor": TensorConfig(
data_gen=partial(
Expand All @@ -168,15 +168,15 @@ def generate_SectionsTensorList2(attrs: List[Dict[str, Any]]):
ops_config = [
{
"op_type": "split",
"op_inputs": dics_intput[num_input],
"op_inputs": dics_input[num_input],
"op_outputs": {"Out": Out},
"op_attrs": dics[0],
}
]
ops = self.generate_op_config(ops_config)
program_config = ProgramConfig(
ops=ops,
weights=dics_intputs[num_input],
weights=dics_inputs[num_input],
inputs={
"split_input": TensorConfig(
data_gen=partial(
Expand Down Expand Up @@ -311,7 +311,7 @@ def generate_input1(attrs: List[Dict[str, Any]]):
"axis": axis,
}
]
dics_intput = [
dics_input = [
{
"X": ["split_input"],
"SectionsTensorList": [
Expand Down Expand Up @@ -354,7 +354,7 @@ def generate_input1(attrs: List[Dict[str, Any]]):
},
{
"op_type": "split",
"op_inputs": dics_intput[0],
"op_inputs": dics_input[0],
"op_outputs": {
"Out": [
"output_var0",
Expand Down
8 changes: 4 additions & 4 deletions test/ir/inference/test_trt_convert_tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def generate_input1(attrs: List[Dict[str, Any]]):
return np.ones([1, 2, 3, 4]).astype(np.float32)

dics = [{}]
dics_intput = [
dics_input = [
{"X": ["tile_input"], "RepeatTimes": ["repeat_times"]},
]
ops_config = [
Expand All @@ -146,7 +146,7 @@ def generate_input1(attrs: List[Dict[str, Any]]):
},
{
"op_type": "tile",
"op_inputs": dics_intput[0],
"op_inputs": dics_input[0],
"op_outputs": {"Out": ["tile_out"]},
"op_attrs": dics[0],
},
Expand Down Expand Up @@ -218,7 +218,7 @@ def generate_input1(attrs: List[Dict[str, Any]]):
return np.ones([1, 2, 3, 4]).astype(np.float32)

dics = [{}]
dics_intput = [
dics_input = [
{
"X": ["tile_input"],
"repeat_times_tensor": ["repeat_times1", "repeat_times2"],
Expand Down Expand Up @@ -247,7 +247,7 @@ def generate_input1(attrs: List[Dict[str, Any]]):
},
{
"op_type": "tile",
"op_inputs": dics_intput[0],
"op_inputs": dics_input[0],
"op_outputs": {"Out": ["tile_out"]},
"op_attrs": dics[0],
},
Expand Down
4 changes: 2 additions & 2 deletions test/xpu/test_reduce_amax_op_xpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ def set_case(self):
'X': np.random.randint(0, 100, self.shape).astype("float32")
}

expect_intput = self.inputs['X']
expect_input = self.inputs['X']
self.outputs = {
'Out': np.amax(
expect_intput,
expect_input,
axis=self.attrs['dim'],
keepdims=self.attrs['keep_dim'],
)
Expand Down

0 comments on commit 7a6ba34

Please sign in to comment.