LLVM 22.0.0git
log_reader Namespace Reference

Classes

class  TensorSpec
class  TensorValue

Functions

TensorValue read_tensor (io.BufferedReader fs, TensorSpec ts)
 pretty_print_tensor_value (TensorValue tv)
 read_header (io.BufferedReader f)
 read_one_observation (Optional[str] context, str event_str, io.BufferedReader f, List[TensorSpec] tensor_specs, Optional[TensorSpec] score_spec)
 read_stream (str fname)
 main (args)

Variables

dict _element_types

Detailed Description

Reader for training log.

See lib/Analysis/TrainingLogger.cpp for a description of the format.

Function Documentation

◆ main()

log_reader.main ( args)

Definition at line 126 of file log_reader.py.

References main(), pretty_print_tensor_value(), print(), and read_stream().

Referenced by main().

◆ pretty_print_tensor_value()

log_reader.pretty_print_tensor_value ( TensorValue tv)

Definition at line 75 of file log_reader.py.

References print().

Referenced by main(), and interactive_host.run_interactive().

◆ read_header()

log_reader.read_header ( io.BufferedReader f)

Definition at line 79 of file log_reader.py.

Referenced by read_stream(), and interactive_host.run_interactive().

◆ read_one_observation()

log_reader.read_one_observation ( Optional[str] context,
str event_str,
io.BufferedReader f,
List[TensorSpec] tensor_specs,
Optional[TensorSpec] score_spec )

Definition at line 87 of file log_reader.py.

References read_tensor().

Referenced by read_stream(), and interactive_host.run_interactive().

◆ read_stream()

log_reader.read_stream ( str fname)

Definition at line 112 of file log_reader.py.

References read_header(), and read_one_observation().

Referenced by main().

◆ read_tensor()

TensorValue log_reader.read_tensor ( io.BufferedReader fs,
TensorSpec ts )

Definition at line 69 of file log_reader.py.

Referenced by read_one_observation().

Variable Documentation

◆ _element_types

dict log_reader._element_types
protected
Initial value:
1= {
2 "float": ctypes.c_float,
3 "double": ctypes.c_double,
4 "int8_t": ctypes.c_int8,
5 "uint8_t": ctypes.c_uint8,
6 "int16_t": ctypes.c_int16,
7 "uint16_t": ctypes.c_uint16,
8 "int32_t": ctypes.c_int32,
9 "uint32_t": ctypes.c_uint32,
10 "int64_t": ctypes.c_int64,
11 "uint64_t": ctypes.c_uint64,
12}

Definition at line 13 of file log_reader.py.