mirror of
https://github.com/wassname/ray.git
synced 2026-09-11 12:43:20 +08:00
[tune] Support lambda functions in hyperparameters / tune rllib multiagent support (#2568)
* update * func * Update registry.py * revert
This commit is contained in:
@@ -51,6 +51,16 @@ def grid_search(values):
|
||||
return {"grid_search": values}
|
||||
|
||||
|
||||
class function(object):
|
||||
"""Wraps `func` to make sure it is not expanded during resolution."""
|
||||
|
||||
def __init__(self, func):
|
||||
self.func = func
|
||||
|
||||
def __call__(self, *args, **kwargs):
|
||||
return self.func(*args, **kwargs)
|
||||
|
||||
|
||||
_STANDARD_IMPORTS = {
|
||||
"random": random,
|
||||
"np": numpy,
|
||||
|
||||
Reference in New Issue
Block a user