mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 17:04:56 +08:00
12 lines
356 B
Python
12 lines
356 B
Python
from collections import namedtuple
|
|
|
|
|
|
class TupleActions(namedtuple("TupleActions", ["batches"])):
|
|
"""Used to return tuple actions as a list of batches per tuple element."""
|
|
|
|
def __new__(cls, batches):
|
|
return super(TupleActions, cls).__new__(cls, batches)
|
|
|
|
def numpy(self):
|
|
return TupleActions([b.numpy() for b in self.batches])
|