MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / append

Method append

examples/DeepQNetwork/expreplay.py:52–63  ·  view source on GitHub ↗

Args: exp (Experience):

(self, exp)

Source from the content-addressed store, hash-verified

50 self.writer_lock = threading.Lock() # a lock to guard writing to the memory
51
52 def append(self, exp):
53 """
54 Args:
55 exp (Experience):
56 """
57 if self._curr_size < self.max_size:
58 self._assign(self._curr_pos, exp)
59 self._curr_pos = (self._curr_pos + 1) % self.max_size
60 self._curr_size += 1
61 else:
62 self._assign(self._curr_pos, exp)
63 self._curr_pos = (self._curr_pos + 1) % self.max_size
64
65 def sample(self, idx):
66 """ return a tuple of (s,r,a,o),

Callers 15

add_git_versionFunction · 0.80
get_costFunction · 0.80
humanize_time_deltaFunction · 0.80
_global_importFunction · 0.80
logger.pyFile · 0.80
feedMethod · 0.80
_pad_channelFunction · 0.80
dump_dataflow_imagesFunction · 0.80
viz.pyFile · 0.80
split_grad_listFunction · 0.80
allreduce_gradsFunction · 0.80

Calls 1

_assignMethod · 0.95

Tested by 1

reset_stateMethod · 0.64