Skip to content

Commit

Permalink
lint f for python
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanghuanrong committed Sep 20, 2023
1 parent b14a2b2 commit c51093e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
12 changes: 0 additions & 12 deletions onnxruntime/python/tools/transformers/convert_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1272,18 +1272,6 @@ def find_past_seq_len_usage(subg: GraphProto):
return tensor_names_to_rename, nodes_to_remove


def dim_of(dim_proto):
return dim_proto.dim_param if hasattr(dim_proto, "dim_param") and dim_proto.dim_param else dim_proto.dim_value


def shape_of(vi):
return tuple([dim_of(dim_proto) for dim_proto in vi.type.tensor_type.shape.dim])


def data_type_of(vi):
return vi.type.tensor_type.elem_type


def update_decoder_subgraph_output_cross_attention(subg: GraphProto):
input_self_past_0 = 1
# w/wo attention mask, w/wo hidden_state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import sys

import onnx
from benchmark_helper import Precision
from convert_generation import get_shared_initializers, update_decoder_subgraph_share_buffer_and_use_decoder_masked_mha
from onnx import TensorProto, helper
from transformers import WhisperConfig

Expand Down Expand Up @@ -236,7 +234,7 @@ def chain_model(args):
if (
(pgi.name not in beam_graph_input_names)
and (pgi.name not in beam_graph_output_names)
and (not pgi.name == "cross_qk")
and (pgi.name != "cross_qk")
):
beam_graph.input.extend([pgi])
beam_graph.output.extend(post_qk_graph.output)
Expand Down

0 comments on commit c51093e

Please sign in to comment.