File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
modelscan/scanners/saved_model Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -57,8 +57,10 @@ def _load_safe_operators() -> List[str]:
5757 try :
5858 with open (operators_file , "r" ) as f :
5959 data = json .load (f )
60- return [
61- operator for operator in list (data .get ("operators" , [])) if operator [0 ] != "_"
60+ return [
61+ operator
62+ for operator in list (data .get ("operators" , []))
63+ if operator [0 ] != "_"
6264 ]
6365
6466 except (FileNotFoundError , json .JSONDecodeError ) as e :
Original file line number Diff line number Diff line change 2020from typing import List , Dict , Any
2121
2222
23- def update_operators_json (
24- json_path : Path
25- ) -> None :
23+ def update_operators_json (json_path : Path ) -> None :
2624 """
2725 Update the JSON file with new version and operators.
2826
@@ -41,14 +39,17 @@ def update_operators_json(
4139 for op in tf .raw_ops .__dict__ .keys ():
4240 operators .append (op )
4341 data = {}
44- data ['description' ] = "List of known TensorFlow raw operators from tensorflow.raw_ops.__dict__.keys()"
45- data ['version' ] = version
46- data ['operators' ] = operators
42+ data ["description" ] = (
43+ "List of known TensorFlow raw operators from tensorflow.raw_ops.__dict__.keys()"
44+ )
45+ data ["version" ] = version
46+ data ["operators" ] = operators
4747
4848 # Write updated file with nice formatting
49- with open (json_path , 'w' ) as f :
49+ with open (json_path , "w" ) as f :
5050 json .dump (data , f , indent = 2 )
5151
52+
5253def main ():
5354 """Main entry point."""
5455 # Determine paths
You can’t perform that action at this time.
0 commit comments