[export] Publicize validate function (#132777)

as titled

Pull Request resolved: https://github.com/pytorch/pytorch/pull/132777
Approved by: https://github.com/zhxchen17
This commit is contained in:
angelayi
2024-08-07 23:10:05 +00:00
committed by PyTorch MergeBot
parent 21d4c48059
commit c327710a87
3 changed files with 13 additions and 8 deletions

View File

@ -716,7 +716,7 @@ class ExportedProgram:
assert all(issubclass(v, Verifier) for v in verifiers)
self._verifiers = verifiers
# Validate should be always the last step of the constructor.
self._validate()
self.validate()
@property
@compatibility(is_backward_compatible=False)
@ -1131,6 +1131,11 @@ class ExportedProgram:
input_placeholders, flat_args_with_path, self.range_constraints
)
@compatibility(is_backward_compatible=False)
def validate(self):
self._validate()
# TODO: remove this
@final
def _validate(self):
assert (