MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / put

Method put

imperative/python/megengine/data/tools/_queue.py:141–156  ·  view source on GitHub ↗
(self, data, block=True, timeout=None)

Source from the content-addressed store, hash-verified

139 return data_buffer
140
141 def put(self, data, block=True, timeout=None):
142 if self.client is None:
143 self.client = plasma.connect(self.socket_name)
144 try:
145 object_id = self.client.put(data)
146 except plasma.PlasmaStoreFull:
147 where = "in DataLoader Plasma Store Put Full"
148 exc_type = "PlasmaStoreFull"
149 error = self.get_error(exc_type, where)
150 object_id = self.client.put((error,))
151
152 try:
153 self.queue.put(object_id, block, timeout)
154 except queue.Full:
155 self.client.delete([object_id])
156 raise queue.Full
157
158 def get(self, block=True, timeout=None):
159 if self.client is None:

Callers 6

_start_serverFunction · 0.45
_run_wrappedFunction · 0.45
_try_put_indexMethod · 0.45
_try_put_indexMethod · 0.45
_worker_loopFunction · 0.45

Calls 2

get_errorMethod · 0.95
connectMethod · 0.45

Tested by

no test coverage detected