Documentation ¶
Index ¶
- Constants
- func DisableHttpRedirect() func(client *http.Client)
- type Endpoint
- type HttpOption
- type PredictClient
- func (p *PredictClient) AddHeader(headerName, headerValue string)
- func (p *PredictClient) BytesPredict(requestData []byte) ([]byte, error)
- func (p *PredictClient) Init() error
- func (p *PredictClient) Predict(request Request) (Response, error)
- func (p *PredictClient) RawRequest(req RawRequest) (*RawResponse, error)
- func (p *PredictClient) SetCompressType(compressType string)
- func (p *PredictClient) SetEndpoint(endpointName string)
- func (p *PredictClient) SetEndpointType(endpointType string)
- func (p *PredictClient) SetHost(host string)
- func (p *PredictClient) SetHttpTransport(transport *http.Transport)
- func (p *PredictClient) SetRetryCount(cnt int)
- func (p *PredictClient) SetServiceName(serviceName string)
- func (p *PredictClient) SetTimeout(timeout int)
- func (p *PredictClient) SetToken(token string)
- func (p *PredictClient) Shutdown()
- func (p *PredictClient) StringPredict(str string) (string, error)
- func (p *PredictClient) TFPredict(request TFRequest) (*TFResponse, error)
- func (p *PredictClient) TorchPredict(request TorchRequest) (*TorchResponse, error)
- func (p *PredictClient) TorchRecPredict(request TorchRecRequest) (*TorchRecResponse, error)
- type PredictError
- type QueueClient
- func (q *QueueClient) AddExtraHeaders(header http.Header)
- func (q *QueueClient) Attributes() (types.Attributes, error)
- func (q *QueueClient) Commit(ctx context.Context, indexes ...uint64) error
- func (q *QueueClient) Del(ctx context.Context, indexes ...uint64) error
- func (q *QueueClient) End(ctx context.Context, force bool) error
- func (q *QueueClient) Get(ctx context.Context, index uint64, length int, timeout time.Duration, ...) (dfs []types.DataFrame, err error)
- func (q *QueueClient) GetByIndex(ctx context.Context, index uint64) (dfs []types.DataFrame, err error)
- func (q *QueueClient) GetByRequestId(ctx context.Context, requestId string) (dfs []types.DataFrame, err error)
- func (q *QueueClient) Negative(ctx context.Context, code types.Code, reason string, indexes ...uint64) error
- func (q *QueueClient) Put(ctx context.Context, data []byte, tags types.Tags) (uint64, string, error)
- func (q *QueueClient) PutWithPath(ctx context.Context, data []byte, path string, tags types.Tags) (uint64, string, error)
- func (q *QueueClient) PutWithPathAndPriority(ctx context.Context, data []byte, customPath string, tags types.Tags, ...) (index uint64, requestId string, err error)
- func (q *QueueClient) PutWithPriority(ctx context.Context, data []byte, tags types.Tags, prio types.Priority) (index uint64, requestId string, err error)
- func (q *QueueClient) Truncate(ctx context.Context, index uint64) error
- func (q *QueueClient) Watch(ctx context.Context, index, window uint64, indexOnly bool, autocommit bool) (types.Watcher, error)
- func (q *QueueClient) WatchByTag(ctx context.Context, index, window uint64, indexOnly bool, autocommit bool, ...) (types.Watcher, error)
- type QueueOption
- type QueueUser
- type RawRequest
- type RawResponse
- type Request
- type Response
- type TFRequest
- func (tr *TFRequest) AddFeedBool(inputName string, shape []int64, content []bool)
- func (tr *TFRequest) AddFeedFloat32(inputName string, shape []int64, content []float32)
- func (tr *TFRequest) AddFeedFloat64(inputName string, shape []int64, content []float64)
- func (tr *TFRequest) AddFeedInt32(inputName string, shape []int64, content []int32)
- func (tr *TFRequest) AddFeedInt64(inputName string, shape []int64, content []int64)
- func (tr *TFRequest) AddFeedString(inputName string, shape []int64, content [][]byte)
- func (tr *TFRequest) AddFetch(outName string)
- func (tr *TFRequest) SetSignatureName(sigName string)
- func (tr TFRequest) ToString() (string, error)
- type TFResponse
- func (tresp *TFResponse) GetBoolVal(outputName string) []bool
- func (tresp *TFResponse) GetDoubleVal(outputName string) []float64
- func (tresp *TFResponse) GetFloatVal(outputName string) []float32
- func (tresp *TFResponse) GetInt64Val(outputName string) []int64
- func (tresp *TFResponse) GetIntVal(outputName string) []int32
- func (tresp *TFResponse) GetStringVal(outputName string) [][]byte
- func (tresp *TFResponse) GetTensorShape(outputName string) []int64
- type TorchRecRequest
- func (tr *TorchRecRequest) AddContextFeature(key string, value interface{}, dtype string)
- func (tr *TorchRecRequest) AddFeat(value interface{}, dtype string) (*torch_predict_protos.PBFeature, error)
- func (tr *TorchRecRequest) AddItemFeature(key string, value interface{}, dtype string)
- func (tr *TorchRecRequest) AddItemId(itemId string)
- func (tr *TorchRecRequest) AddToListField(feat *torch_predict_protos.PBFeature, value interface{}, dtype string) (*torch_predict_protos.PBFeature, error)
- func (tr *TorchRecRequest) AddToMapField(feat *torch_predict_protos.PBFeature, value interface{}, dtype string) (*torch_predict_protos.PBFeature, error)
- func (tr *TorchRecRequest) AddUserFeature(key string, value interface{}, dtype string)
- func (tr *TorchRecRequest) SetDebugLevel(debug_level int32)
- func (tr *TorchRecRequest) SetFaissNeighNum(k int32)
- func (tr TorchRecRequest) ToString() (string, error)
- type TorchRecResponse
- func (resp *TorchRecResponse) GetDoubleValMap(outIndex string) []float64
- func (resp *TorchRecResponse) GetFloatValMap(outIndex string) []float32
- func (resp *TorchRecResponse) GetInt64ValMap(outIndex string) []int64
- func (resp *TorchRecResponse) GetIntValMap(outIndex string) []int32
- func (resp *TorchRecResponse) GetTensorShapeMap(outIndex string) []int64
- type TorchRequest
- func (tr *TorchRequest) AddFeedFloat32(index int, shape []int64, content []float32)
- func (tr *TorchRequest) AddFeedFloat64(index int, shape []int64, content []float64)
- func (tr *TorchRequest) AddFeedInt32(index int, shape []int64, content []int32)
- func (tr *TorchRequest) AddFeedInt64(index int, shape []int64, content []int64)
- func (tr *TorchRequest) AddFeedMapFloat32(index string, shape []int64, content []float32)
- func (tr *TorchRequest) AddFeedMapFloat64(index string, shape []int64, content []float64)
- func (tr *TorchRequest) AddFeedMapInt32(index string, shape []int64, content []int32)
- func (tr *TorchRequest) AddFeedMapInt64(index string, shape []int64, content []int64)
- func (tr *TorchRequest) AddFetch(outIndex int32)
- func (tr *TorchRequest) SetDebugLevel(debug_level int32)
- func (tr TorchRequest) ToString() (string, error)
- type TorchResponse
- func (resp *TorchResponse) GetDoubleVal(outIndex int) []float64
- func (resp *TorchResponse) GetDoubleValMap(outIndex string) []float64
- func (resp *TorchResponse) GetFloatVal(outIndex int) []float32
- func (resp *TorchResponse) GetFloatValMap(outIndex string) []float32
- func (resp *TorchResponse) GetInt64Val(outIndex int) []int64
- func (resp *TorchResponse) GetInt64ValMap(outIndex string) []int64
- func (resp *TorchResponse) GetIntVal(outIndex int) []int32
- func (resp *TorchResponse) GetIntValMap(outIndex string) []int32
- func (resp *TorchResponse) GetTensorShape(outIndex int) []int64
- func (resp *TorchResponse) GetTensorShapeMap(outIndex string) []int64
Constants ¶
const ( // Default endpoint is the gateway mode EndpointTypeDefault = "DEFAULT" // Vipserver endpoint is only used for services which registered // vipsever domains in alibaba internal clusters EndpointTypeVipserver = "VIPSERVER" // Direct endpoint is used for direct accessing to the services' instances // both inside a eas service and in user's client ecs EndpointTypeDirect = "DIRECT" )
const ( CompressTypeGzip = "Gzip" CompressTypeZlib = "Zlib" )
const ( ErrorCodeServiceDiscovery = 510 ErrorCodeCreateRequest = 511 ErrorCodePerformRequest = 512 ErrorCodeReadResponse = 513 )
const ( HeaderRequestId = "X-Eas-Queueservice-Request-Id" HeaderAccessRear = "X-EAS-QueueService-Access-Rear" HeaderAuthorization = "Authorization" DefaultBasePath = "/api/predict" DefaultGroupName = "eas" )
const ( TfType_DT_FLOAT tf_predict_protos.ArrayDataType = tf_predict_protos.ArrayDataType_DT_FLOAT TfType_DT_DOUBLE tf_predict_protos.ArrayDataType = tf_predict_protos.ArrayDataType_DT_DOUBLE TfType_DT_INT32 tf_predict_protos.ArrayDataType = tf_predict_protos.ArrayDataType_DT_INT32 TfType_DT_UINT8 tf_predict_protos.ArrayDataType = tf_predict_protos.ArrayDataType_DT_UINT8 TfType_DT_INT16 tf_predict_protos.ArrayDataType = tf_predict_protos.ArrayDataType_DT_INT16 TfType_DT_INT8 tf_predict_protos.ArrayDataType = tf_predict_protos.ArrayDataType_DT_INT8 TfType_DT_STRING tf_predict_protos.ArrayDataType = tf_predict_protos.ArrayDataType_DT_STRING TfType_DT_INT64 tf_predict_protos.ArrayDataType = tf_predict_protos.ArrayDataType_DT_INT64 TfType_DT_BOOL tf_predict_protos.ArrayDataType = tf_predict_protos.ArrayDataType_DT_BOOL )
TfType_DT_INVALID and listed types use ALL_CAPS names here to consist with other language's sdk.
const ( // TorchType_DT_FLOAT and listed types use ALL_CAPS names here to consist with other language's sdk. TorchType_DT_FLOAT torch_predict_protos.ArrayDataType = torch_predict_protos.ArrayDataType_DT_FLOAT TorchType_DT_DOUBLE torch_predict_protos.ArrayDataType = torch_predict_protos.ArrayDataType_DT_DOUBLE TorchType_DT_INT32 torch_predict_protos.ArrayDataType = torch_predict_protos.ArrayDataType_DT_INT32 TorchType_DT_UINT8 torch_predict_protos.ArrayDataType = torch_predict_protos.ArrayDataType_DT_UINT8 TorchType_DT_INT16 torch_predict_protos.ArrayDataType = torch_predict_protos.ArrayDataType_DT_INT16 TorchType_DT_INT8 torch_predict_protos.ArrayDataType = torch_predict_protos.ArrayDataType_DT_INT8 TorchType_DT_INT64 torch_predict_protos.ArrayDataType = torch_predict_protos.ArrayDataType_DT_INT64 )
Variables ¶
This section is empty.
Functions ¶
func DisableHttpRedirect ¶
Types ¶
type HttpOption ¶
type PredictClient ¶
type PredictClient struct {
// contains filtered or unexported fields
}
PredictClient for accessing prediction service by creating a fixed size connection pool to perform the request through established persistent connections.
func NewPredictClient ¶
func NewPredictClient(endpointName string, serviceName string, options ...HttpOption) *PredictClient
NewPredictClient returns an instance of PredictClient
func (*PredictClient) AddHeader ¶
func (p *PredictClient) AddHeader(headerName, headerValue string)
func (*PredictClient) BytesPredict ¶
func (p *PredictClient) BytesPredict(requestData []byte) ([]byte, error)
BytesPredict send the raw request data in byte array through http connections, retry the request automatically when an error occurs
func (*PredictClient) Init ¶
func (p *PredictClient) Init() error
Init initializes the predict client to create and enable endpoint discovery
func (*PredictClient) Predict ¶
func (p *PredictClient) Predict(request Request) (Response, error)
Predict for request
func (*PredictClient) RawRequest ¶
func (p *PredictClient) RawRequest(req RawRequest) (*RawResponse, error)
RawRequest sends the raw request in raw http Request, retry the request automatically when an error occurs
func (*PredictClient) SetCompressType ¶
func (p *PredictClient) SetCompressType(compressType string)
SetCompressType sets compressor type for client
func (*PredictClient) SetEndpoint ¶
func (p *PredictClient) SetEndpoint(endpointName string)
SetEndpoint sets service's endpoint for client
func (*PredictClient) SetEndpointType ¶
func (p *PredictClient) SetEndpointType(endpointType string)
SetEndpointType sets endpoint type for client
func (*PredictClient) SetHost ¶
func (p *PredictClient) SetHost(host string)
func (*PredictClient) SetHttpTransport ¶
func (p *PredictClient) SetHttpTransport(transport *http.Transport)
SetHttpTransport sets http transport argument for go http client
func (*PredictClient) SetRetryCount ¶
func (p *PredictClient) SetRetryCount(cnt int)
SetRetryCount sets max retry count for client
func (*PredictClient) SetServiceName ¶
func (p *PredictClient) SetServiceName(serviceName string)
SetServiceName sets target service name for client
func (*PredictClient) SetTimeout ¶
func (p *PredictClient) SetTimeout(timeout int)
SetTimeout set the request timeout for client, 5000ms by default
func (*PredictClient) SetToken ¶
func (p *PredictClient) SetToken(token string)
SetToken function sets service's access token for client
func (*PredictClient) Shutdown ¶
func (p *PredictClient) Shutdown()
Shutdown after called this client instance should not be used again
func (*PredictClient) StringPredict ¶
func (p *PredictClient) StringPredict(str string) (string, error)
StringPredict function send input data and return predicted result
func (*PredictClient) TFPredict ¶
func (p *PredictClient) TFPredict(request TFRequest) (*TFResponse, error)
TFPredict function send input data and return TensorFlow predicted result
func (*PredictClient) TorchPredict ¶
func (p *PredictClient) TorchPredict(request TorchRequest) (*TorchResponse, error)
TorchPredict function send input data and return PyTorch predicted result
func (*PredictClient) TorchRecPredict ¶
func (p *PredictClient) TorchRecPredict(request TorchRecRequest) (*TorchRecResponse, error)
TorchRecPredict function send input data and return TorchRec predicted result
type PredictError ¶
PredictError is a custom err type
func NewPredictError ¶
func NewPredictError(code int, url string, msg string) *PredictError
NewPredictError constructs an error
type QueueClient ¶
type QueueClient struct { WebsocketWatch bool // codecs for data frame and attributes. DCodec types.DataFrameCodec ACodec types.AttributesCodec // contains filtered or unexported fields }
QueueClient is client of queue server, which also implements queue service interface
func NewQueueClient ¶
func NewQueueClient(endpoint, queueName, token string, opts ...QueueOption) (*QueueClient, error)
func (*QueueClient) AddExtraHeaders ¶
func (q *QueueClient) AddExtraHeaders(header http.Header)
func (*QueueClient) Attributes ¶
func (q *QueueClient) Attributes() (types.Attributes, error)
func (*QueueClient) Commit ¶
func (q *QueueClient) Commit(ctx context.Context, indexes ...uint64) error
Commit commits the indexes to the queue, as the result, the data in queue will not be delivered again.
func (*QueueClient) Del ¶
func (q *QueueClient) Del(ctx context.Context, indexes ...uint64) error
Del deletes the indexes from the queue, the content of the indexes will also be deleted.
func (*QueueClient) Get ¶
func (q *QueueClient) Get(ctx context.Context, index uint64, length int, timeout time.Duration, autoDelete bool, tags types.Tags) (dfs []types.DataFrame, err error)
Get gets data from queue, it returns the data frames and error. Parameters:
- index: the start point to get data, if index is 0, it will search from the queue head.
- length: the number of data frames to get.
- timeout: the timeout duration to wait for data, if timeout is 0, it will return immediately.
- autoDelete: if autoDelete is true, the data will be deleted from queue after it is read.
- tags: the tags to filter data.
func (*QueueClient) GetByIndex ¶
func (q *QueueClient) GetByIndex(ctx context.Context, index uint64) (dfs []types.DataFrame, err error)
GetByIndex gets data from queue by index, make convenience wrapper for Get.
func (*QueueClient) GetByRequestId ¶
func (q *QueueClient) GetByRequestId(ctx context.Context, requestId string) (dfs []types.DataFrame, err error)
GetByRequestId gets data from queue by request id, make convenience wrapper for Get.
func (*QueueClient) Put ¶
func (q *QueueClient) Put(ctx context.Context, data []byte, tags types.Tags) (uint64, string, error)
Put puts data into queue. It returns the index of the data in queue, and generated request id.
func (*QueueClient) PutWithPath ¶
func (*QueueClient) PutWithPathAndPriority ¶
func (q *QueueClient) PutWithPathAndPriority(ctx context.Context, data []byte, customPath string, tags types.Tags, prio types.Priority) (index uint64, requestId string, err error)
PutWithPriority puts data into queue with path and priority. It returns the index of the data in queue, and generated request id. The prioritized data will be received by Watcher before normal data.
func (*QueueClient) PutWithPriority ¶
func (*QueueClient) Truncate ¶
func (q *QueueClient) Truncate(ctx context.Context, index uint64) error
Truncate truncates the queue to the given index, the specified index is not included.
func (*QueueClient) WatchByTag ¶
func (q *QueueClient) WatchByTag(ctx context.Context, index, window uint64, indexOnly bool, autocommit bool, tags types.Tags) (types.Watcher, error)
WatchByTag returns a Watcher which can be used to receive data from the queue in streaming fashion. Parameters:
- index: the index to start watching from.
- window: the window size to watch.
- indexOnly: if true, only the index will be returned, otherwise the whole data frame will be returned.
- autocommit: if true, the index will be automatically committed after the data frame is received.
- tags: the tags to watch.
type QueueOption ¶
type QueueOption func(*queueOptions)
func WithBasePath ¶
func WithBasePath(basePath string) QueueOption
func WithExtraHeaders ¶
func WithExtraHeaders(extraHeaders map[string]string) QueueOption
func WithGroupId ¶
func WithGroupId(gid string) QueueOption
func WithUserId ¶
func WithUserId(uid string) QueueOption
type QueueUser ¶
type QueueUser struct {
// contains filtered or unexported fields
}
func NewQueueUser ¶
type RawRequest ¶
func (RawRequest) ToString ¶
func (r RawRequest) ToString() (string, error)
type RawResponse ¶
type RawResponse struct {
// contains filtered or unexported fields
}
func (RawResponse) ToBytes ¶
func (r RawResponse) ToBytes() []byte
type TFRequest ¶
type TFRequest struct {
RequestData tf_predict_protos.PredictRequest
}
TFRequest class for tensorflow data and requests
func (*TFRequest) AddFeedBool ¶
AddFeedBool function adds boolean values input data for TFRequest
func (*TFRequest) AddFeedFloat32 ¶
AddFeedFloat32 function adds float values input data for TFRequest
func (*TFRequest) AddFeedFloat64 ¶
AddFeedFloat64 function adds double values input data for TFRequest
func (*TFRequest) AddFeedInt32 ¶
AddFeedInt32 function adds int values input data for TFRequest
func (*TFRequest) AddFeedInt64 ¶
AddFeedInt64 function adds int64 values input data for TFRequest
func (*TFRequest) AddFeedString ¶
AddFeedString function adds string values input data for TFRequest
func (*TFRequest) SetSignatureName ¶
SetSignatureName set signature name for TensorFlow request
type TFResponse ¶
type TFResponse struct {
Response tf_predict_protos.PredictResponse
}
TFResponse class for Pytf predicted results
func (*TFResponse) GetBoolVal ¶
func (tresp *TFResponse) GetBoolVal(outputName string) []bool
GetBoolVal returns []bool slice as output data
func (*TFResponse) GetDoubleVal ¶
func (tresp *TFResponse) GetDoubleVal(outputName string) []float64
GetDoubleVal returns []float64 slice as output data
func (*TFResponse) GetFloatVal ¶
func (tresp *TFResponse) GetFloatVal(outputName string) []float32
GetFloatVal returns []float32 slice as output data
func (*TFResponse) GetInt64Val ¶
func (tresp *TFResponse) GetInt64Val(outputName string) []int64
GetInt64Val returns []int64 slice as output data
func (*TFResponse) GetIntVal ¶
func (tresp *TFResponse) GetIntVal(outputName string) []int32
GetIntVal returns []int32 slice as output data
func (*TFResponse) GetStringVal ¶
func (tresp *TFResponse) GetStringVal(outputName string) [][]byte
GetStringVal returns []string slice as output data
func (*TFResponse) GetTensorShape ¶
func (tresp *TFResponse) GetTensorShape(outputName string) []int64
GetTensorShape returns []int64 slice as shape of tensor outindexed
type TorchRecRequest ¶
type TorchRecRequest struct {
RequestData torch_predict_protos.PBRequest
}
TorchRecRequest class for PyTorch data and requests
func (*TorchRecRequest) AddContextFeature ¶
func (tr *TorchRecRequest) AddContextFeature(key string, value interface{}, dtype string)
add context features for torchrecrequest
func (*TorchRecRequest) AddFeat ¶
func (tr *TorchRecRequest) AddFeat(value interface{}, dtype string) (*torch_predict_protos.PBFeature, error)
func (*TorchRecRequest) AddItemFeature ¶
func (tr *TorchRecRequest) AddItemFeature(key string, value interface{}, dtype string)
add item features for torchrecrequest
func (*TorchRecRequest) AddItemId ¶
func (tr *TorchRecRequest) AddItemId(itemId string)
add item ids for torchrecrequest
func (*TorchRecRequest) AddToListField ¶
func (tr *TorchRecRequest) AddToListField(feat *torch_predict_protos.PBFeature, value interface{}, dtype string) (*torch_predict_protos.PBFeature, error)
func (*TorchRecRequest) AddToMapField ¶
func (tr *TorchRecRequest) AddToMapField(feat *torch_predict_protos.PBFeature, value interface{}, dtype string) (*torch_predict_protos.PBFeature, error)
func (*TorchRecRequest) AddUserFeature ¶
func (tr *TorchRecRequest) AddUserFeature(key string, value interface{}, dtype string)
add user features for torchrecrequest
func (*TorchRecRequest) SetDebugLevel ¶
func (tr *TorchRecRequest) SetDebugLevel(debug_level int32)
Set Debug level for torchrecrequest
func (*TorchRecRequest) SetFaissNeighNum ¶
func (tr *TorchRecRequest) SetFaissNeighNum(k int32)
Set FaissNeighNum for torchrecrequest
func (TorchRecRequest) ToString ¶
func (tr TorchRecRequest) ToString() (string, error)
ToString for interface
type TorchRecResponse ¶
type TorchRecResponse struct {
Response torch_predict_protos.PBResponse
}
TorchResponse class for PyTorch predicted results
func (*TorchRecResponse) GetDoubleValMap ¶
func (resp *TorchRecResponse) GetDoubleValMap(outIndex string) []float64
GetDoubleValMap returns []float64 slice as output data
func (*TorchRecResponse) GetFloatValMap ¶
func (resp *TorchRecResponse) GetFloatValMap(outIndex string) []float32
GetFloatValMap returns []float32 slice as output data
func (*TorchRecResponse) GetInt64ValMap ¶
func (resp *TorchRecResponse) GetInt64ValMap(outIndex string) []int64
GetInt64ValMap returns []int64 slice as output data
func (*TorchRecResponse) GetIntValMap ¶
func (resp *TorchRecResponse) GetIntValMap(outIndex string) []int32
GetIntValMap returns []int32 slice as output data
func (*TorchRecResponse) GetTensorShapeMap ¶
func (resp *TorchRecResponse) GetTensorShapeMap(outIndex string) []int64
GetTensorShape returns []int64 slice as shape of tensor outindexed
type TorchRequest ¶
type TorchRequest struct {
RequestData torch_predict_protos.PredictRequest
}
TorchRequest class for PyTorch data and requests
func (*TorchRequest) AddFeedFloat32 ¶
func (tr *TorchRequest) AddFeedFloat32(index int, shape []int64, content []float32)
AddFeedFloat32 function adds float values input data for torchrequest
func (*TorchRequest) AddFeedFloat64 ¶
func (tr *TorchRequest) AddFeedFloat64(index int, shape []int64, content []float64)
AddFeedFloat64 function adds double values input data for torchrequest
func (*TorchRequest) AddFeedInt32 ¶
func (tr *TorchRequest) AddFeedInt32(index int, shape []int64, content []int32)
AddFeedInt32 function adds int values input data for torchrequest
func (*TorchRequest) AddFeedInt64 ¶
func (tr *TorchRequest) AddFeedInt64(index int, shape []int64, content []int64)
AddFeedInt64 function adds int64 values input data for torchrequest
func (*TorchRequest) AddFeedMapFloat32 ¶
func (tr *TorchRequest) AddFeedMapFloat32(index string, shape []int64, content []float32)
AddFeedMapFloat32 function adds float values map_input data for torchrequest
func (*TorchRequest) AddFeedMapFloat64 ¶
func (tr *TorchRequest) AddFeedMapFloat64(index string, shape []int64, content []float64)
AddFeedMapFloat64 function adds double values map_input data for torchrequest
func (*TorchRequest) AddFeedMapInt32 ¶
func (tr *TorchRequest) AddFeedMapInt32(index string, shape []int64, content []int32)
AddFeedMapInt32 function adds int values map_input data for torchrequest
func (*TorchRequest) AddFeedMapInt64 ¶
func (tr *TorchRequest) AddFeedMapInt64(index string, shape []int64, content []int64)
AddFeedMapInt64 function adds int64 values map_input data for torchrequest
func (*TorchRequest) AddFetch ¶
func (tr *TorchRequest) AddFetch(outIndex int32)
AddFetch add OutputFilter (outIndex) for response
func (*TorchRequest) SetDebugLevel ¶
func (tr *TorchRequest) SetDebugLevel(debug_level int32)
Set Debug level for torchrequest
func (TorchRequest) ToString ¶
func (tr TorchRequest) ToString() (string, error)
ToString for interface
type TorchResponse ¶
type TorchResponse struct {
Response torch_predict_protos.PredictResponse
}
TorchResponse class for PyTorch predicted results
func (*TorchResponse) GetDoubleVal ¶
func (resp *TorchResponse) GetDoubleVal(outIndex int) []float64
GetDoubleVal returns []float64 slice as output data
func (*TorchResponse) GetDoubleValMap ¶
func (resp *TorchResponse) GetDoubleValMap(outIndex string) []float64
GetDoubleValMap returns []float64 slice as output data
func (*TorchResponse) GetFloatVal ¶
func (resp *TorchResponse) GetFloatVal(outIndex int) []float32
GetFloatVal returns []float32 slice as output data
func (*TorchResponse) GetFloatValMap ¶
func (resp *TorchResponse) GetFloatValMap(outIndex string) []float32
GetFloatValMap returns []float32 slice as output data
func (*TorchResponse) GetInt64Val ¶
func (resp *TorchResponse) GetInt64Val(outIndex int) []int64
GetInt64Val returns []int64 slice as output data
func (*TorchResponse) GetInt64ValMap ¶
func (resp *TorchResponse) GetInt64ValMap(outIndex string) []int64
GetInt64ValMap returns []int64 slice as output data
func (*TorchResponse) GetIntVal ¶
func (resp *TorchResponse) GetIntVal(outIndex int) []int32
GetIntVal returns []int32 slice as output data
func (*TorchResponse) GetIntValMap ¶
func (resp *TorchResponse) GetIntValMap(outIndex string) []int32
GetIntValMap returns []int32 slice as output data
func (*TorchResponse) GetTensorShape ¶
func (resp *TorchResponse) GetTensorShape(outIndex int) []int64
GetTensorShape returns []int64 slice as shape of tensor outindexed
func (*TorchResponse) GetTensorShapeMap ¶
func (resp *TorchResponse) GetTensorShapeMap(outIndex string) []int64
GetTensorShapeMap returns []int64 slice as shape of tensor outindexed