@@ -851,7 +851,8 @@ RELAY_REGISTER_OP("relax.builtin.alloc_tensor")
851851 " The storage scope of the storage to allocate. Default is global." )
852852 .set_attr<FInferStructInfo>(" FInferStructInfo" , InferStructInfoAllocateTensor)
853853 // memory allocation isn't considered a "visible effect" as far as purity is concerned
854- .set_attr<Bool>(" FPurity" , Bool(true ));
854+ .set_attr<Bool>(" FPurity" , Bool(true ))
855+ .set_attr<Bool>(" TAllocator" , Bool(true ));
855856
856857Expr MakeAllocTensor (Expr shape, DataTypeImm dtype, PrimValue runtime_device_index,
857858 StringImm storage_scope) {
@@ -875,7 +876,8 @@ RELAY_REGISTER_OP("relax.memory.alloc_storage")
875876 .add_argument(" dtype" , " DataTypeImm" , " The dtype of the tensor to allocate." )
876877 .set_attr<FInferStructInfo>(" FInferStructInfo" , ReturnObjectStructInfo)
877878 // memory allocation isn't considered a "visible effect" as far as purity is concerned
878- .set_attr<Bool>(" FPurity" , Bool(true ));
879+ .set_attr<Bool>(" FPurity" , Bool(true ))
880+ .set_attr<Bool>(" TAllocator" , Bool(true ));
879881
880882Expr MakeAllocStorage (Expr size, PrimValue virtual_device_index, StringImm storage_scope,
881883 DataTypeImm dtype) {
@@ -906,7 +908,8 @@ RELAY_REGISTER_OP("relax.memory.alloc_tensor")
906908 .add_argument(" dtype" , " DataTypeImm" , " The dtype of the tensor to allocate." )
907909 .set_attr<FInferStructInfo>(" FInferStructInfo" , InferStructInfoMemAllocTensor)
908910 // memory allocation isn't considered a "visible effect" as far as purity is concerned
909- .set_attr<Bool>(" FPurity" , Bool(true ));
911+ .set_attr<Bool>(" FPurity" , Bool(true ))
912+ .set_attr<Bool>(" TAllocator" , Bool(true ));
910913
911914Expr MakeMemAllocTensor (Expr storage, PrimValue offset, Expr shape, DataTypeImm dtype) {
912915 static const Op& op = Op::Get (" relax.memory.alloc_tensor" );
@@ -960,7 +963,8 @@ RELAY_REGISTER_OP("relax.vm.alloc_storage")
960963 " The storage scope of the storage to allocate. Default is global." )
961964 .set_attr<FInferStructInfo>(" FInferStructInfo" , ReturnObjectStructInfo)
962965 // memory allocation isn't considered a "visible effect" as far as purity is concerned
963- .set_attr<Bool>(" FPurity" , Bool(true ));
966+ .set_attr<Bool>(" FPurity" , Bool(true ))
967+ .set_attr<Bool>(" TAllocator" , Bool(true ));
964968
965969Expr MakeVMAllocStorage (Expr size, PrimValue runtime_device_index, DataTypeImm dtype,
966970 StringImm storage_scope) {
@@ -998,7 +1002,8 @@ RELAY_REGISTER_OP("relax.vm.alloc_tensor")
9981002 .add_argument(" dtype" , " DataTypeImm" , " The dtype of the tensor to allocate." )
9991003 .set_attr<FInferStructInfo>(" FInferStructInfo" , InferStructInfoVMAllocTensor)
10001004 // memory allocation isn't considered a "visible effect" as far as purity is concerned
1001- .set_attr<Bool>(" FPurity" , Bool(true ));
1005+ .set_attr<Bool>(" FPurity" , Bool(true ))
1006+ .set_attr<Bool>(" TAllocator" , Bool(true ));
10021007
10031008Expr MakeVMAllocTensor (Expr storage, PrimValue offset, Expr shape, DataTypeImm dtype) {
10041009 static const Op& op = Op::Get (" relax.vm.alloc_tensor" );
0 commit comments