ingest

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewParser

func NewParser() *parser

Types

type EventCallbackBase added in v0.0.2

type EventCallbackBase[V interface{}] func(string, float64, int64, V)

type Ingester

type Ingester interface {
	// FetchUpdates fetches updates from the TFRecord file incrementally.
	// User should call this function periodically in order to get the latest updates.
	// return error means unexpected file content, user should close the Ingester.
	// Notes: FetchUpdates is not thread-safe.
	// Return value is the number of events added to the run.
	FetchUpdates(ctx context.Context) (int, error)

	Close() error

	GetRun() *Run
}

Ingester is an interface for ingesting TFRecord file

func NewIngester

func NewIngester(name string, path string) (Ingester, error)

type Run

type Run struct {
	Name    string
	Scalars map[string]*ScalarEvents
	Texts   map[string]*TextEvents
}

func NewRun

func NewRun(name string) *Run

func (*Run) AddScalarEvent

func (r *Run) AddScalarEvent(tag string, timestamp float64, step int64, value float32)

func (*Run) AddTextEvent added in v0.0.2

func (r *Run) AddTextEvent(tag string, timestamp float64, step int64, value string)

type ScalarEventCallback

type ScalarEventCallback = EventCallbackBase[float32]

type ScalarEvents

type ScalarEvents struct {
	// These three slices are parallel in order to save memory.
	// i.e. the i-th element of each slice corresponds to the same event.
	Timestamp []float64
	Step      []int64
	Value     []float32
}

type TextEventCallback added in v0.0.2

type TextEventCallback = EventCallbackBase[string]

type TextEvents added in v0.0.2

type TextEvents struct {
	// These three slices are parallel in order to save memory.
	// i.e. the i-th element of each slice corresponds to the same event.
	Timestamp []float64
	Step      []int64
	Value     []string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL