mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[JIT] Modify is_mutable in FunctionSchema and SchemaInfo to have SchemaArgument parameter instead of index (#81784)
- Modify the is_mutable(size_t index) overload to become is_mutable(const SchemaArgument& argument) due to cases where one might want to check the mutability of either input or output arguments. - Refactored all calls to the function to use this new overload - Tested through is_mutable() tests in test_schema_info.cpp Pull Request resolved: https://github.com/pytorch/pytorch/pull/81784 Approved by: https://github.com/davidberard98
This commit is contained in:
committed by
PyTorch MergeBot
parent
41d054ab11
commit
c9497886fd
@ -1676,7 +1676,9 @@ void initJITBindings(PyObject* module) {
|
||||
.def("is_mutable", [](SchemaInfo& self) { return self.is_mutable(); })
|
||||
.def(
|
||||
"is_mutable",
|
||||
[](SchemaInfo& self, size_t index) { return self.is_mutable(index); })
|
||||
[](SchemaInfo& self, const SchemaArgument& argument) {
|
||||
return self.is_mutable(argument);
|
||||
})
|
||||
.def(
|
||||
"is_mutable",
|
||||
[](SchemaInfo& self, const std::string& name) {
|
||||
|
Reference in New Issue
Block a user