MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / read

Method read

tensorflow/python/ops/io_ops.py:144–171  ·  view source on GitHub ↗

Returns the next record (key, value) pair produced by a reader. Will dequeue a work unit from queue if necessary (e.g. when the Reader needs to start reading from a new file since it has finished with the previous file). Args: queue: A Queue or a mutable string Tensor represe

(self, queue, name=None)

Source from the content-addressed store, hash-verified

142 return self._reader_ref
143
144 def read(self, queue, name=None):
145 """Returns the next record (key, value) pair produced by a reader.
146
147 Will dequeue a work unit from queue if necessary (e.g. when the
148 Reader needs to start reading from a new file since it has
149 finished with the previous file).
150
151 Args:
152 queue: A Queue or a mutable string Tensor representing a handle
153 to a Queue, with string work items.
154 name: A name for the operation (optional).
155
156 Returns:
157 A tuple of Tensors (key, value).
158 key: A string scalar Tensor.
159 value: A string scalar Tensor.
160 """
161 if isinstance(queue, ops.Tensor):
162 queue_ref = queue
163 else:
164 queue_ref = queue.queue_ref
165 if self._reader_ref.dtype == dtypes.resource:
166 return gen_io_ops.reader_read_v2(self._reader_ref, queue_ref, name=name)
167 else:
168 # For compatibility with pre-resource queues, create a ref(string) tensor
169 # which can be looked up as the same queue by a resource manager.
170 old_queue_op = gen_data_flow_ops.fake_queue(queue_ref)
171 return gen_io_ops.reader_read(self._reader_ref, old_queue_op, name=name)
172
173 def read_up_to(self, queue, num_records, # pylint: disable=invalid-name
174 name=None):

Callers 15

sed_in_placeFunction · 0.45
get_ndk_api_levelFunction · 0.45
read_configFunction · 0.45
read_configFunction · 0.45
bin2bin.pyFile · 0.45
convert_funcMethod · 0.45
_time_stepFunction · 0.45
_time_stepFunction · 0.45
_time_stepFunction · 0.45
_time_stepFunction · 0.45
gen_timelineFunction · 0.45
mainFunction · 0.45

Calls

no outgoing calls

Tested by 15

upload_benchmark_filesFunction · 0.36
test_writeMethod · 0.36
test_replace_refesMethod · 0.36
mainFunction · 0.36
testInplaceMethod · 0.36
testInplaceMethod · 0.36
testStripUnusedMethod · 0.36