@@ -498,7 +498,6 @@ void AliasDb::analyzeImpl(Node* node) {
498
498
case prim::tolist:
499
499
return analyzeCreator (node);
500
500
case prim::TupleConstruct:
501
- return analyzeTupleConstruct (node);
502
501
case prim::DictConstruct:
503
502
case prim::ListConstruct:
504
503
return analyzeContainerConstruct (node);
@@ -865,30 +864,20 @@ void AliasDb::analyzeConservative(Node* node) {
865
864
}
866
865
}
867
866
868
- void AliasDb::analyzeTupleConstruct (Node* node) {
869
- TORCH_INTERNAL_ASSERT (node->kind () == prim::TupleConstruct);
870
- // tuples which contain immutable types are immutable
871
- if (!isMutableTypeInternal (node->output ())) {
872
- return ;
873
- }
874
-
875
- giveFreshAlias (node->output ());
876
-
877
- for (const auto & input : node->inputs ()) {
878
- if (isMutableTypeInternal (input)) {
879
- addToContainedElements (input, node->output ());
880
- }
881
- }
882
- }
883
-
884
867
// List or dict or tuple: construct: create an aliasing element for the actual
885
868
// container, then mark all inputs as wildcards, since they've gone inside the
886
869
// container. Then, add the wildcard sets of appropriate type to the contained
887
870
// elements of the container.
888
871
void AliasDb::analyzeContainerConstruct (Node* node) {
889
872
TORCH_INTERNAL_ASSERT (
890
873
node->kind () == prim::ListConstruct ||
891
- node->kind () == prim::DictConstruct);
874
+ node->kind () == prim::DictConstruct ||
875
+ node->kind () == prim::TupleConstruct);
876
+
877
+ // tuples which contain immutable types are immutable
878
+ if (!isMutableTypeInternal (node->output ())) {
879
+ return ;
880
+ }
892
881
893
882
TORCH_INTERNAL_ASSERT (node->outputs ().size () == 1 );
894
883
auto container = node->output ();
0 commit comments