mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 19:01:10 +08:00
Treat static methods as class methods instead of instance methods in actors (#6756)
* Treat static methods as class methods rather than instance methods * Add tests for static methods in actors * Revert formatting changes * Readd future imports * Restructure static method check * Documentation enhancements * Fix linting issues
This commit is contained in:
committed by
Edward Oakes
parent
2e972e725a
commit
c480d1d1e4
@@ -21,6 +21,7 @@ from ray.utils import (
|
||||
binary_to_hex,
|
||||
is_function_or_method,
|
||||
is_class_method,
|
||||
is_static_method,
|
||||
check_oversized_pickle,
|
||||
decode,
|
||||
ensure_str,
|
||||
@@ -753,7 +754,9 @@ class FunctionActorManager:
|
||||
|
||||
# Execute the assigned method and save a checkpoint if necessary.
|
||||
try:
|
||||
if is_class_method(method):
|
||||
is_bound = (is_class_method(method)
|
||||
or is_static_method(type(actor), method_name))
|
||||
if is_bound:
|
||||
method_returns = method(*args, **kwargs)
|
||||
else:
|
||||
method_returns = method(actor, *args, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user