Documentation
¶
Index ¶
- Constants
- func ProcessTensorGetReply(reply interface{}, errIn error) (err error, dtype string, shape []int, data interface{})
- func ProcessTensorReplyValues(dtype string, reply interface{}) (data interface{}, err error)
- func TensorGetTypeStrFromType(dtype reflect.Type) (typestr string, err error)
- type AiClient
- type Client
- func (c *Client) ActiveConnNX()
- func (c *Client) Close() (err error)
- func (c *Client) DisablePipeline() (err error)
- func (c *Client) DoOrSend(cmdName string, args redis.Args, errIn error) (reply interface{}, err error)
- func (c *Client) Flush() (err error)
- func (c *Client) Info(key string) (map[string]string, error)
- func (c *Client) LoadBackend(backend_identifier string, location string) (err error)
- func (c *Client) ModelDel(keyName string) (err error)
- func (c *Client) ModelGet(keyName string) (data []interface{}, err error)
- func (c *Client) ModelGetToModel(keyName string, modelIn ModelInterface) (err error)
- func (c *Client) ModelRun(name string, inputTensorNames, outputTensorNames []string) (err error)
- func (c *Client) ModelSet(keyName, backend, device string, data []byte, inputs, outputs []string) (err error)
- func (c *Client) ModelSetFromModel(keyName string, model ModelInterface) (err error)
- func (c *Client) Pipeline(PipelineAutoFlushAtSize uint32)
- func (c *Client) Receive() (reply interface{}, err error)
- func (c *Client) ResetStat(key string) (string, error)
- func (c *Client) ScriptDel(name string) (err error)
- func (c *Client) ScriptGet(name string) (data map[string]string, err error)
- func (c *Client) ScriptRun(name string, fn string, inputs []string, outputs []string) (err error)
- func (c *Client) ScriptSet(name string, device string, script_source string) (err error)
- func (c *Client) SendAndIncr(commandName string, args redis.Args) (err error)
- func (c *Client) TensorGet(name, format string) (data []interface{}, err error)
- func (c *Client) TensorGetBlob(name string) (dt string, shape []int, data []byte, err error)
- func (c *Client) TensorGetMeta(name string) (dt string, shape []int, err error)
- func (c *Client) TensorGetToTensor(name, format string, tensor TensorInterface) (err error)
- func (c *Client) TensorGetValues(name string) (dt string, shape []int, data interface{}, err error)
- func (c *Client) TensorSet(keyName, dt string, dims []int, data interface{}) (err error)
- func (c *Client) TensorSetFromTensor(keyName string, tensor TensorInterface) (err error)
- type ModelInterface
- type TensorInterface
Constants ¶
const ( // BackendTF represents a TensorFlow backend BackendTF = string("TF") // BackendTorch represents a Torch backend BackendTorch = string("TORCH") // BackendONNX represents an ONNX backend BackendONNX = string("ORT") // DeviceCPU represents a CPU device DeviceCPU = string("CPU") // DeviceGPU represents a GPU device DeviceGPU = string("GPU") // TypeFloat represents a float type TypeFloat = string("FLOAT") // TypeDouble represents a double type TypeDouble = string("DOUBLE") // TypeInt8 represents a int8 type TypeInt8 = string("INT8") // TypeInt16 represents a int16 type TypeInt16 = string("INT16") // TypeInt32 represents a int32 type TypeInt32 = string("INT32") // TypeInt64 represents a int64 type TypeInt64 = string("INT64") // TypeUint8 represents a uint8 type TypeUint8 = string("UINT8") // TypeUint16 represents a uint16 type TypeUint16 = string("UINT16") // TypeFloat32 is an alias for float TypeFloat32 = string("FLOAT") // TypeFloat64 is an alias for double TypeFloat64 = string("DOUBLE") // TensorContentTypeBLOB is an alias for BLOB tensor content TensorContentTypeBlob = string("BLOB") // TensorContentTypeBLOB is an alias for BLOB tensor content TensorContentTypeValues = string("VALUES") // TensorContentTypeBLOB is an alias for BLOB tensor content TensorContentTypeMeta = string("META") )
Variables ¶
This section is empty.
Functions ¶
func ProcessTensorGetReply ¶ added in v0.99.1
Types ¶
type Client ¶
type Client struct { Pool *redis.Pool PipelineActive bool PipelineAutoFlushSize uint32 PipelinePos uint32 ActiveConn redis.Conn }
Client is a RedisAI client
func (*Client) ActiveConnNX ¶
func (c *Client) ActiveConnNX()
func (*Client) Close ¶
Close ensures that no connection is kept alive and prior to that we flush all db commands
func (*Client) DisablePipeline ¶
func (*Client) LoadBackend ¶
func (*Client) ModelGetToModel ¶ added in v0.99.1
func (c *Client) ModelGetToModel(keyName string, modelIn ModelInterface) (err error)
func (*Client) ModelRun ¶
ModelRun runs the model present in the keyName, with the input tensor names, and output tensor names
func (*Client) ModelSet ¶
func (c *Client) ModelSet(keyName, backend, device string, data []byte, inputs, outputs []string) (err error)
ModelSet sets a RedisAI model from a blob
func (*Client) ModelSetFromModel ¶ added in v0.99.1
func (c *Client) ModelSetFromModel(keyName string, model ModelInterface) (err error)
ModelSet sets a RedisAI model from a structure that implements the ModelInterface
func (*Client) SendAndIncr ¶
func (*Client) TensorGetBlob ¶
TensorGetValues gets a tensor's values
func (*Client) TensorGetMeta ¶
TensorGetValues gets a tensor's values
func (*Client) TensorGetToTensor ¶ added in v0.99.1
func (c *Client) TensorGetToTensor(name, format string, tensor TensorInterface) (err error)
func (*Client) TensorGetValues ¶
TensorGetValues gets a tensor's values
func (*Client) TensorSetFromTensor ¶ added in v0.99.1
func (c *Client) TensorSetFromTensor(keyName string, tensor TensorInterface) (err error)
TensorSet sets a tensor
type ModelInterface ¶ added in v0.99.1
type ModelInterface interface { Outputs() []string SetOutputs(outputs []string) Inputs() []string SetInputs(inputs []string) Blob() []byte SetBlob(blob []byte) Device() string SetDevice(device string) Backend() string SetBackend(backend string) }
ModelInterface is an interface that represents the skeleton of a model needed to map it to a RedisAI Model with the proper operations
type TensorInterface ¶ added in v0.99.1
type TensorInterface interface { // Shape returns the size - in each dimension - of the tensor. Shape() []int SetShape(shape []int) // NumDims returns the number of dimensions of the tensor. NumDims() int // Len returns the number of elements in the tensor. Len() int Dtype() reflect.Type // Data returns the underlying tensor data Data() interface{} SetData(interface{}) }
TensorInterface is an interface that represents the skeleton of a tensor ( n-dimensional array of numerical data ) needed to map it to a RedisAI Model with the proper operations