MCPcopy Index your code
hub / github.com/tensorflow/tfjs / iterator

Method iterator

tfjs-data/src/datasets/text_line_dataset.ts:38–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36 }
37
38 async iterator(): Promise<LazyIterator<string>> {
39 const inputIterator = await this.input.iterator();
40 const utf8Iterator = inputIterator.decodeUTF8();
41 const lineIterator = utf8Iterator.split('\n').map(line => {
42 // Windows/DOS format text file has extra line breaker at the end of line.
43 if (line.endsWith('\r')) {
44 line = line.slice(0, -1);
45 }
46 return line;
47 });
48 return lineIterator;
49 }
50}

Callers

nothing calls this directly

Calls 2

splitMethod · 0.65
sliceMethod · 0.65

Tested by

no test coverage detected