Skip to content

Commit

Permalink
PyLint fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
popovaan committed May 14, 2024
1 parent 2d949d7 commit 3b60c09
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ def extract(cls, node):
'visualize_threshold': visualize_threshold,
'save_file': param.save_file,
# nms_param
'nms_threshold': nms_threshold,
'top_k': top_k,
'eta': eta,
'nms_threshold': nms_threshold, # pylint: disable=possibly-used-before-assignment
'top_k': top_k, # pylint: disable=possibly-used-before-assignment
'eta': eta, # pylint: disable=possibly-used-before-assignment
# save_output_param
'output_directory': param.save_output_param.output_directory,
'output_name_prefix': param.save_output_param.output_name_prefix,
Expand All @@ -111,7 +111,7 @@ def extract(cls, node):
'width': param.save_output_param.resize_param.width,
'height_scale': param.save_output_param.resize_param.height_scale,
'width_scale': param.save_output_param.resize_param.width_scale,
'pad_mode': pad_mode,
'pad_mode': pad_mode, # pylint: disable=possibly-used-before-assignment
'pad_value': ','.join(str(x) for x in param.save_output_param.resize_param.pad_value),
'interp_mode': interp_mode,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def extract(cls, node: Node) -> bool:
'kernel_spatial_idx': [2, 3],
'group': 1,
'reshape_kernel': True,
'appended_conv': appended_conv
'appended_conv': appended_conv # pylint: disable=possibly-used-before-assignment
}

mapping_rule.update(layout_attrs())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def replace_op(self, graph: Graph, node: Node):
if node['use_dropout']:
mul_dropout_i = Mul(graph, {'name': split_node.soft_get('name', split_node.id) + '/mul_i'}).create_node()
mul_dropout_i.in_port(0).connect(i_sigmoid.out_port(0))
mul_dropout_i.in_port(1).connect(i_drop_scale)
mul_dropout_i.in_port(1).connect(i_drop_scale) # pylint: disable=possibly-used-before-assignment
i_sigmoid = mul_dropout_i

# f_t = Sigmoid(f_part + w_fc*ct_1)
Expand All @@ -91,7 +91,7 @@ def replace_op(self, graph: Graph, node: Node):
if node['use_dropout']:
mul_dropout_f = Mul(graph, {'name': split_node.soft_get('name', split_node.id) + '/mul_f'}).create_node()
mul_dropout_f.in_port(0).connect(f_sigmoid.out_port(0))
mul_dropout_f.in_port(1).connect(f_drop_scale)
mul_dropout_f.in_port(1).connect(f_drop_scale) # pylint: disable=possibly-used-before-assignment
f_sigmoid = mul_dropout_f

# c_t = f_t*ct_1 + i_t * tanh(c_part)
Expand Down Expand Up @@ -127,7 +127,7 @@ def replace_op(self, graph: Graph, node: Node):
if node['use_dropout']:
mul_dropout_o = Mul(graph, {'name': split_node.soft_get('name', split_node.id) + '/mul_o'}).create_node()
mul_dropout_o.in_port(0).connect(o_sigmoid.out_port(0))
mul_dropout_o.in_port(1).connect(o_drop_scale)
mul_dropout_o.in_port(1).connect(o_drop_scale) # pylint: disable=possibly-used-before-assignment
o_sigmoid = mul_dropout_o

# m_t = o_t * Tanh(c_t)
Expand Down
4 changes: 2 additions & 2 deletions tools/mo/openvino/tools/mo/middle/MXNetSplitMultiLayers.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def split_multilayer_cell(self, graph: Graph, match: dict):
).create_node_with_data()

if have_hidden:
layer_hidden_state = hidden_state_value[l * direction: l * direction + direction]
layer_hidden_state = hidden_state_value[l * direction: l * direction + direction] # pylint: disable=possibly-used-before-assignment
hidden_state_value_node = Const(
rnn_layer.graph,
dict(name=name + '/LayerSplittedHiddenState/{}/'.format(l), value=layer_hidden_state)
Expand All @@ -115,7 +115,7 @@ def split_multilayer_cell(self, graph: Graph, match: dict):
hidden_state_value_node = None

if have_cell:
layer_cell_state = cell_state_value[l * direction: l * direction + direction]
layer_cell_state = cell_state_value[l * direction: l * direction + direction] # pylint: disable=possibly-used-before-assignment
cell_state_value_node = Const(
rnn_layer.graph,
dict(name=name + '/LayerSplittedCellState/{}/'.format(l), value=layer_cell_state)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def normalize_strided_slice(graph: Graph, node: Node):
if num_insertions > 0:
# insert blank values for ellipsis unrolling and extending
for mask_name in StridedSlice.get_mask_names():
node[mask_name] = np.insert(node[mask_name], insertion_start_idx, [0] * num_insertions).astype(int)
node[mask_name] = np.insert(node[mask_name], insertion_start_idx, [0] * num_insertions).astype(int) # pylint: disable=possibly-used-before-assignment

@staticmethod
def unroll_ellipsis_for_inputs(graph: Graph, node: Node, ellipsis_start: int, num_insertions: int):
Expand Down
2 changes: 1 addition & 1 deletion tools/mo/openvino/tools/mo/ops/one_hot.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def infer(node: Node):
hot_idx = *idx, indices[idx]

if -depth <= indices[idx] < depth:
onehot_value[hot_idx] = on_value
onehot_value[hot_idx] = on_value # pylint: disable=possibly-used-before-assignment

node.out_port(0).data.set_value(onehot_value)

Expand Down

0 comments on commit 3b60c09

Please sign in to comment.