File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -936,15 +936,15 @@ def graph_inputs(
936
936
yield from (r for r in ancestors (graphs , blockers ) if r .owner is None )
937
937
938
938
939
- def required_graph_inputs (
939
+ def explicit_graph_inputs (
940
940
graph : Variable [Any , Any ] | Iterable [Variable [Any , Any ]],
941
941
) -> Generator [Variable , None , None ]:
942
942
"""
943
943
Get the inputs into PyTensor variables
944
944
945
945
Parameters
946
946
----------
947
- graph: PyTensor `Variable` instances
947
+ graph: TensorVariable
948
948
Output `Variable` instances from which to search backward through
949
949
owners.
950
950
@@ -969,7 +969,7 @@ def required_graph_inputs(
969
969
# x [id A]
970
970
# 2 [id B]
971
971
972
- pytensor.dprint(required_graph_inputs ([z]))
972
+ pytensor.dprint(explicit_graph_inputs ([z]))
973
973
# x [id A]
974
974
"""
975
975
from pytensor .compile .sharedvalue import SharedVariable
Original file line number Diff line number Diff line change 18
18
clone ,
19
19
clone_get_equiv ,
20
20
equal_computations ,
21
+ explicit_graph_inputs ,
21
22
general_toposort ,
22
23
get_var_by_name ,
23
24
graph_inputs ,
24
25
io_toposort ,
25
26
list_of_nodes ,
26
27
orphans_between ,
27
- required_graph_inputs ,
28
28
truncated_graph_inputs ,
29
29
variable_depends_on ,
30
30
vars_between ,
@@ -523,15 +523,15 @@ def test_graph_inputs():
523
523
assert res_list == [r3 , r1 , r2 ]
524
524
525
525
526
- def test_required_graph_inputs ():
526
+ def test_explicit_graph_inputs ():
527
527
x = pt .fscalar ()
528
528
y = pt .constant (2 )
529
529
z = shared (1 )
530
530
a = pt .sum (x + y + z )
531
531
b = pt .true_div (x , y )
532
532
533
- res = list (required_graph_inputs ([a ]))
534
- res1 = list (required_graph_inputs (b ))
533
+ res = list (explicit_graph_inputs ([a ]))
534
+ res1 = list (explicit_graph_inputs (b ))
535
535
assert res , res1 == [x ]
536
536
537
537
You can’t perform that action at this time.
0 commit comments