Skip to content

Commit

Permalink
Merge pull request #50 from japsonzbz/dev-20210603
Browse files Browse the repository at this point in the history
Fixed parameter errors in @ray.Remote() and @ray.Method()
  • Loading branch information
mGalarnyk authored Jun 29, 2021
2 parents 21d7b28 + f929ad4 commit 64b5b7d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ray-crash-course/06-Exploring-Ray-API-Calls.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"| :--- | :--- | :------ | :---------- |\n",
"| `num_cpus` | `int` | `num_cpus=4` | The number of CPU cores to reserve for this task or for the lifetime of the actor. |\n",
"| `num_gpus` | `int` | `num_gpus=1` | The number of GPU cores to reserve for this task or for the lifetime of the actor. |\n",
"| `num_return_vals` | `int` | `num_return_vals=2` | (Only for tasks, not actors.) The number of object refs returned by the remote function invocation. |\n",
"| `num_returns` | `int` | `num_returns=2` | (Only for tasks, not actors.) The number of object refs returned by the remote function invocation. |\n",
"| `resources` | `map` | `resources={'flibberts': 5}` | The quantity of various custom resources to reserve for this task or for the lifetime of the actor. This is a dictionary mapping strings (resource names) to numbers. |\n",
"| `max_calls` | `int` | `max_calls=5` | Only for *remote tasks*. This specifies the maximum of times that a given worker can execute the given remote function before it must exit (this can be used to address memory leaks in third-party libraries or to reclaim resources that cannot easily be released, e.g., GPU memory that was acquired by TensorFlow). By default this is infinite. |\n",
"| `max_restarts` | `int` | `max_restarts=-1` | Only for *actors*. This specifies the maximum number of times that the actor should be restarted when it dies unexpectedly. The minimum valid value is 0 (default), which indicates that the actor doesn't need to be restarted. A value of -1 indicates that an actor should be restarted indefinitely. |\n",
Expand All @@ -136,7 +136,7 @@
"metadata": {},
"outputs": [],
"source": [
"@ray.remote(num_return_vals=3)\n",
"@ray.remote(num_returns=3)\n",
"def tuple3(one, two, three):\n",
" return (one, two, three)\n",
"\n",
Expand All @@ -159,7 +159,7 @@
"source": [
"### @ray.method()\n",
"\n",
"Related to `@ray.remote()`, [@ray.method()](https://ray.readthedocs.io/en/latest/package-ref.html#ray.method) allows you to specify the number of return values for a method in an actor, by passing the `num_return_vals` keyword argument. None of the other `@ray.remote()` keyword arguments are allowed. Here is an example:"
"Related to `@ray.remote()`, [@ray.method()](https://ray.readthedocs.io/en/latest/package-ref.html#ray.method) allows you to specify the number of return values for a method in an actor, by passing the `num_returns` keyword argument. None of the other `@ray.remote()` keyword arguments are allowed. Here is an example:"
]
},
{
Expand All @@ -170,7 +170,7 @@
"source": [
"@ray.remote\n",
"class Tupleator:\n",
" @ray.method(num_return_vals=3)\n",
" @ray.method(num_returns=3)\n",
" def tuple3(self, one, two, three):\n",
" return (one, two, three)\n",
" \n",
Expand Down Expand Up @@ -337,4 +337,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}

0 comments on commit 64b5b7d

Please sign in to comment.