@@ -678,7 +678,7 @@ def fgraph_to_python(
678
678
fgraph : FunctionGraph ,
679
679
op_conversion_fn : Callable ,
680
680
* ,
681
- type_conversion_fn : Callable = lambda x , ** kwargs : x ,
681
+ const_conversion_fn : Callable = lambda x , ** kwargs : x ,
682
682
order : Optional [List [Apply ]] = None ,
683
683
storage_map : Optional ["StorageMapType" ] = None ,
684
684
fgraph_name : str = "fgraph_to_python" ,
@@ -698,8 +698,8 @@ def fgraph_to_python(
698
698
A callable used to convert nodes inside `fgraph` based on their `Op`
699
699
types. It must have the signature
700
700
``(op: Op, node: Apply=None, storage_map: Dict[Variable, List[Optional[Any]]]=None, **kwargs)``.
701
- type_conversion_fn
702
- A callable used to convert the values in `storage_map`. It must have
701
+ const_conversion_fn
702
+ A callable used to convert the `Constant` values in `storage_map`. It must have
703
703
the signature
704
704
``(value: Optional[Any], variable: Variable=None, storage: List[Optional[Any]]=None, **kwargs)``.
705
705
order
@@ -753,7 +753,7 @@ def fgraph_to_python(
753
753
)
754
754
if input_storage [0 ] is not None or isinstance (i , Constant ):
755
755
# Constants need to be assigned locally and referenced
756
- global_env [local_input_name ] = type_conversion_fn (
756
+ global_env [local_input_name ] = const_conversion_fn (
757
757
input_storage [0 ], variable = i , storage = input_storage , ** kwargs
758
758
)
759
759
# TODO: We could attempt to use the storage arrays directly
@@ -776,7 +776,7 @@ def fgraph_to_python(
776
776
output_storage = storage_map .setdefault (
777
777
out , [None if not isinstance (out , Constant ) else out .data ]
778
778
)
779
- global_env [local_output_name ] = type_conversion_fn (
779
+ global_env [local_output_name ] = const_conversion_fn (
780
780
output_storage [0 ],
781
781
variable = out ,
782
782
storage = output_storage ,
0 commit comments