Documentation
¶
Overview ¶
Package flatten provides utilities to flatten/unflatten interpreter elements.
Index ¶
- func Flatten(elts ...ir.Element) ([]ir.Element, error)
- func ParseCompositeOf[T values.Value](f func(ir.Type, []values.Value) (T, error)) func(ir.Type, []values.Value) (values.Value, error)
- type Flattener
- type Parser
- func (h *Parser) CallInputs() *values.FuncInputs
- func (h *Parser) Device() platform.Device
- func (h *Parser) Next() platform.DeviceHandle
- func (h *Parser) ParseArray(typ ir.Type) (values.Array, error)
- func (h *Parser) ParseComposite(ncv newCompValue, typ ir.Type, els []ir.Element) (values.Value, error)
- func (h *Parser) String() string
- func (h *Parser) Unflatten(el ir.Element) (values.Value, error)
- type Unflattener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Flattener ¶
type Flattener interface { // Flatten the element, that is: // returns itself if the element is atomic, // returns its components if the element is a composite. Flatten() ([]ir.Element, error) }
Flattener is an element that can be flattened.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser unflattens the output of a graph computation into GX values.
func NewParser ¶
func NewParser(dev platform.Device, callInputs *values.FuncInputs, handles []platform.DeviceHandle) *Parser
NewParser returns a new parser given the output of a graph computation.
func (*Parser) CallInputs ¶
func (h *Parser) CallInputs() *values.FuncInputs
CallInputs returns the inputs with which the function was called.
func (*Parser) Device ¶
Device returns to which transfers the host value to. TODO(b/388207169): Always transfer the value to device because C++ bindings do not support HostValue.
func (*Parser) Next ¶
func (h *Parser) Next() platform.DeviceHandle
Next returns a the next handle and moves the cursor to the succeeding handle.
func (*Parser) ParseArray ¶
ParseArray the next value as an array.
Click to show internal directories.
Click to hide internal directories.