tfrecords: simplify and transplant the tfrecords
Project description
tfrecords
simplify and transplant the tfrecord dataset
record write and read demo
import tfrecords
options = tfrecords.TFRecordOptions(compression_type=tfrecords.TFRecordCompressionType.NONE)
def test_write(filename, N=3, context='aaa'):
with tfrecords.TFRecordWriter(filename, options=options) as file_writer:
for _ in range(N):
# x, y = np.random.random(), np.random.random()
file_writer.write(context + '____' + str(_))
def test_record_iterator():
example_paths = tfrecords.glob('d:/example.tfrecords*')
for example_path in example_paths:
iterator = tfrecords.tf_record_iterator(example_path, options=options)
num = 0
for iter in iterator:
num += 1
print(iter)
def test_random_reader():
example_paths = tfrecords.glob('d:/example.tfrecords*')
for example_path in example_paths:
file_reader = tfrecords.tf_record_random_reader(example_path, options=options)
last_pos = 0
while True:
try:
x,pos = file_reader.read(last_pos)
print(x)
last_pos = pos
except:
break
test_write('d:/example.tfrecords0',3,'file0')
test_write('d:/example.tfrecords1',10,'file1')
test_write('d:/example.tfrecords2',12,'file2')
print('\ntest_record_iterator')
test_record_iterator()
print('\ntest_random_reader')
test_random_reader()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for tfrecords-0.0.4-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e2724799cec1566564ff3fd56f862552c7c4d1fab446ba5fdcdec75961543b5 |
|
MD5 | 84444cf82d3bc8db1c96642059d40bed |
|
BLAKE2b-256 | 6abbc6330a488149f7a49f344fdaadae490c33c93e2eed1c8b68e542b151d20a |
Close
Hashes for tfrecords-0.0.4-cp310-cp310-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea30b1c926fe1b339979c112412f4dc32c5764b7dbea01bd5b017edf47805f53 |
|
MD5 | fcbda8447c1ecf37ab54750d38e65062 |
|
BLAKE2b-256 | 2863db5e9f6862fa6ec109cccc97dfc3cf12a38f8e1d6f90061a0738e340fa9f |
Close
Hashes for tfrecords-0.0.4-cp310-cp310-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84b42865e3bdc7f4b35239de6a75b2b2fa281c32ef029a24ca0cebe87b7e9822 |
|
MD5 | b3bebeb776ed06d0b21f2a93ceb86bb8 |
|
BLAKE2b-256 | 0f804b09808607d36a3f9055695b637b613fc2b2e0db5fe1fa98fa7419ef0649 |
Close
Hashes for tfrecords-0.0.4-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74bb69ebbf162a71d36fc2599a4ba3281bc2d81bd807118c71b5f8cb55746477 |
|
MD5 | df97b8c4d3af301ebfece5b1c1acae42 |
|
BLAKE2b-256 | bdd698707811690bda350667bd7c5f96228c148b05674b63578a7e285ce28c43 |
Close
Hashes for tfrecords-0.0.4-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8ba581495f79e542bf2e47ce47392baedc21dcb6724de594c009d838ccf952a |
|
MD5 | 65c5783e2e15115c4b306a9fbf46e957 |
|
BLAKE2b-256 | 586a052cd9d0fcc6da779681278a815030de0ab6517adec1b9a795f110191305 |
Close
Hashes for tfrecords-0.0.4-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2449894f8da1625989256f0b03a08c9bb1c1c50433e3649a81c0409a939d08e0 |
|
MD5 | 961050fc219b553b1e5ee6e3ab6c39c2 |
|
BLAKE2b-256 | a7d9b59e4f99cc17adfebc0ba7a4baf086b0a1014f4ca6438f67140b6b4e6d3a |
Close
Hashes for tfrecords-0.0.4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73cc58692335e66672bb3e992b91c6faba5f2636cf561330cf92e7b45f82e707 |
|
MD5 | 1050b3cdc37fd53a6644c8c28166aa17 |
|
BLAKE2b-256 | c4bc8d604a5322679cd77c72129259a786499b58a8e0518ed13d6e08f947f1d2 |
Close
Hashes for tfrecords-0.0.4-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85b41a25fb546736e1fe494444c41a2f4bd46ddc076e749340bcf6004989dfcd |
|
MD5 | 0b133b52c9fd5dd1266ee4cffc2cb5db |
|
BLAKE2b-256 | c0b789c41c8fac3b80372f446d71e4b3b2a85ddcd585a749b6df64ea72d36174 |
Close
Hashes for tfrecords-0.0.4-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 948eb77513e3be147f11a9f169684f0443bc304208d1454e2a7a5009ff2b0238 |
|
MD5 | 184b002cc327975804e0936a0642ac86 |
|
BLAKE2b-256 | 6f5092a4d65db19a371d29aa007757cb47f92c3001e288ad7c04a26313f19178 |
Close
Hashes for tfrecords-0.0.4-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d05371fdc062efeb6e28c7dcc1af77a4c37ad7762d9b5631314275d0fa92142 |
|
MD5 | 7b575b68bf3e314a22e103f27d35bcff |
|
BLAKE2b-256 | 971aac8039b8d7dade160d688a5f27135e954d954f65a5bc8054fc76967a5714 |
Close
Hashes for tfrecords-0.0.4-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98e06cb578f8eb237d2e8c736c87114bcc469fa8ba91314110afe116616bc0d9 |
|
MD5 | 90920051ac8c117e16648fe31248dd3f |
|
BLAKE2b-256 | f9333fba5671f42933612422b66797aec834451e04f1ba57456e9cae89f97f5b |
Close
Hashes for tfrecords-0.0.4-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7454116c00afcfaa32f8552fcc6ed8aa17b1a805167fde5237304183f9471bcc |
|
MD5 | 9e6a8c97fe7635ccd55858b494fd6d79 |
|
BLAKE2b-256 | 5927b36c596926478af5996d271000138091602d5af14fd605f939f97100dc2a |
Close
Hashes for tfrecords-0.0.4-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82f84eecebab0073322e78dab7fbd8ada451cda6804dd1013b903448b791b8f4 |
|
MD5 | 866583b97e190c3698a5f7844813a00f |
|
BLAKE2b-256 | d91357bd6728cff524494f9126b9ba88a6e7c59ab8bd84ce1671648af70ccbd2 |
Close
Hashes for tfrecords-0.0.4-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78abe1eb1d55eb67d43631f18f71f628ee05a870a243833a2697cdcc3cd5dfc0 |
|
MD5 | 484f29af895c96d1b376ad199a06560b |
|
BLAKE2b-256 | 1dd9fb45c74bd2231130ad7b79e6b8e0b63f50a7e43f10008d93f5b0dadf18bb |
Close
Hashes for tfrecords-0.0.4-cp36-cp36m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc51558d5c130d4b6a6138cc1f7c4179b331ea1d085abb409df77d18baee8e68 |
|
MD5 | 9dd8aa33b2046b35fba21ad437bdc15d |
|
BLAKE2b-256 | 6f94b8f469361ed99441a0c99d5b006795fd76964c9a09445df9ac367fae1bd5 |