MCPcopy
hub / github.com/PaddlePaddle/PaddleRec / _bytes_feature

Function _bytes_feature

tools/dataset/tfrecord_reader.py:27–33  ·  view source on GitHub ↗

Returns a bytes_list from a string / byte.

(value)

Source from the content-addressed store, hash-verified

25
26
27def _bytes_feature(value):
28 """Returns a bytes_list from a string / byte."""
29 if isinstance(value, type(tf.constant(0))):
30 value = value.numpy(
31 ) # BytesList won't unpack a string from an EagerTensor.
32 value = value if isinstance(value, list) else [value]
33 return tf.train.Feature(bytes_list=tf.train.BytesList(value=value))
34
35
36def _float_feature(value):

Callers

nothing calls this directly

Calls 1

numpyMethod · 0.80

Tested by

no test coverage detected