rithwik-db commented on code in PR #41973:
URL: https://github.com/apache/spark/pull/41973#discussion_r1264028111
##########
python/pyspark/ml/torch/distributor.py:
##########
@@ -910,17 +932,20 @@ def run(self, train_object: Union[Callable, str], *args:
Any, **kwargs: Any) ->
train_object is a Callable with an expected output. Returns None
if train_object is
a file.
"""
+ return self._run(train_object,
TorchDistributor._run_training_on_pytorch_file, *args, **kwargs)
+
+ def _run(self, train_object: Union[Callable, str], run_pytorch_file_fn:
Callable, *args: Any, **kwargs: Any) -> Optional[Any]:
if isinstance(train_object, str):
- framework_wrapper_fn =
TorchDistributor._run_training_on_pytorch_file
+ framework_wrapper_fn = run_pytorch_file_fn
Review Comment:
This breaks parity and readability; I wouldn't recommend this change
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]