1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//! Core data model for the [WebDataset](https://github.com/webdataset/webdataset) format.
//!
//! WebDataset stores a dataset as a set of POSIX tar archives ("shards"). The
//! files inside a shard that share a basename make up one training sample:
//!
//! ```text
//! shard-000000.tar
//! image0001.jpg image0001.cls image0001.json
//! image0002.jpg image0002.cls image0002.json
//! ```
//!
//! This crate defines the pieces every other crate in the workspace shares:
//!
//! - [`Sample`] and [`Value`] — the in-memory shape of a training example.
//! - [`Tensor`] and [`DType`] — dense numeric arrays, plus the [`npy`] codec.
//! - [`Error`] and [`handlers`] — how failures are reported and absorbed.
//! - [`braceexpand()`] and [`utils`] — shard-list expansion and worker identity.
//!
//! Most users should depend on the `webdataset` crate instead, which
//! re-exports everything here.
//!
//! # `no_std`
//!
//! Turning off the `std` feature builds against `core` and `alloc` only, which
//! covers the whole data model: samples, values, tensors, the `.npy` codec,
//! brace expansion, and the error and handler types. What `std` adds is the
//! parts that need an operating system — `Error::Io`, environment variable
//! substitution, reading worker identity from the environment, and the
//! stream-based `npy` helpers.
//!
//! ```toml
//! webdataset-core = { version = "0.1", default-features = false, features = ["json"] }
//! ```
//!
//! # Threads
//!
//! The `threads` feature — on by default — makes per-worker state thread-safe.
//! With the standard library that is a thread-local and needs no setup. Without
//! it, there is no portable way to ask which thread is running, so the host
//! supplies one with
//! [`workers::set_thread_id_hook`]; see the [`workers`]
//! module. A single-threaded `no_std` program needs neither.
extern crate alloc;
/// The items the `std` prelude would provide, sourced from `alloc` so that the
/// same code compiles with and without `std`.
pub use ;
pub use ;
pub use ;
pub use ;
pub use Sample;
pub use ;
pub use ;
pub use ;
pub use ;