state

package
v0.0.0-...-772e789 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package state contains objects for holding and manipulating the state of a physical model.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Meter

type Meter struct {
	// contains filtered or unexported fields
}

Meter is a tensor with units of Meters.

func (Meter) Value

func (t Meter) Value() interface{}

type SinkFunc

type SinkFunc func(...Tensor) error

SinkFunc represents a function that does something with the result of the State computation.

type State

type State struct {
	// contains filtered or unexported fields
}

State holds the state of the model and the computational graph that operates on it.

func NewState

func NewState() *State

NewState creates a new State.

func (*State) Add

func (s *State) Add(a, b Tensor) Tensor

Add returns the result of element-wise addition of the inputs.

func (*State) AddSink

func (s *State) AddSink(f SinkFunc, tensors ...Tensor)

AddSink registers a function that does something with the results of the State computation, for example saving them to a file.

func (*State) New2DFloat32

func (s *State) New2DFloat32(a [][]float32, u unit.Unit) Tensor

New2DFloat32 creates a new static tensor from the input.

func (*State) NewScalarFloat32

func (s *State) NewScalarFloat32(a float32, u unit.Unit) Tensor

NewScalarFloat32 creates a new static tensor from the input.

func (*State) Run

func (s *State) Run() error

Run fills the provided output tensors with values.

type Tensor

type Tensor interface {
	Value() interface{}
	// contains filtered or unexported methods
}

Tensor hold tensor data.

Directories

Path Synopsis
Package unit defines scientific units.
Package unit defines scientific units.

Jump to

Keyboard shortcuts

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