Skip to content

Commit 81ac224

Browse files
normalize int(32) usage to int64 (#19)
* [add] extended godoc with 10 more examples for Model and Tensor related commands * [add] moving from int(32) to int64 across all package
1 parent e4943ff commit 81ac224

File tree

14 files changed

+358
-101
lines changed

14 files changed

+358
-101
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func main() {
6161

6262
// Set a tensor
6363
// AI.TENSORSET foo FLOAT 2 2 VALUES 1.1 2.2 3.3 4.4
64-
_ = client.TensorSet("foo", redisai.TypeFloat, []int{2, 2}, []float32{1.1, 2.2, 3.3, 4.4})
64+
_ = client.TensorSet("foo", redisai.TypeFloat, []int64{2, 2}, []float32{1.1, 2.2, 3.3, 4.4})
6565

6666
// Get a tensor content as a slice of values
6767
// dt DataType, shape []int, data interface{}, err error
@@ -98,12 +98,12 @@ func main() {
9898

9999
// Set a tensor
100100
// AI.TENSORSET foo FLOAT 2 2 VALUES 1.1 2.2 3.3 4.4
101-
err := client.TensorSet("foo1", redisai.TypeFloat, []int{2, 2}, []float32{1.1, 2.2, 3.3, 4.4})
101+
err := client.TensorSet("foo1", redisai.TypeFloat, []int64{2, 2}, []float32{1.1, 2.2, 3.3, 4.4})
102102
if err != nil {
103103
log.Fatal(err)
104104
}
105105
// AI.TENSORSET foo2 FLOAT 1" 1 VALUES 1.1
106-
err = client.TensorSet("foo2", redisai.TypeFloat, []int{1, 1}, []float32{1.1})
106+
err = client.TensorSet("foo2", redisai.TypeFloat, []int64{1, 1}, []float32{1.1})
107107
if err != nil {
108108
log.Fatal(err)
109109
}

examples/redisai_pipelined_client/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ func main() {
1616

1717
// Set a tensor
1818
// AI.TENSORSET foo FLOAT 2 2 VALUES 1.1 2.2 3.3 4.4
19-
err := client.TensorSet("foo1", redisai.TypeFloat, []int{2, 2}, []float32{1.1, 2.2, 3.3, 4.4})
19+
err := client.TensorSet("foo1", redisai.TypeFloat, []int64{2, 2}, []float32{1.1, 2.2, 3.3, 4.4})
2020
if err != nil {
2121
log.Fatal(err)
2222
}
2323
// AI.TENSORSET foo2 FLOAT 1" 1 VALUES 1.1
24-
err = client.TensorSet("foo2", redisai.TypeFloat, []int{1, 1}, []float32{1.1})
24+
err = client.TensorSet("foo2", redisai.TypeFloat, []int64{1, 1}, []float32{1.1})
2525
if err != nil {
2626
log.Fatal(err)
2727
}

examples/redisai_simple_client/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func main() {
1313

1414
// Set a tensor
1515
// AI.TENSORSET foo FLOAT 2 2 VALUES 1.1 2.2 3.3 4.4
16-
_ = client.TensorSet("foo", redisai.TypeFloat, []int{2, 2}, []float32{1.1, 2.2, 3.3, 4.4})
16+
_ = client.TensorSet("foo", redisai.TypeFloat, []int64{2, 2}, []float32{1.1, 2.2, 3.3, 4.4})
1717

1818
// Get a tensor content as a slice of values
1919
// dt DataType, shape []int, data interface{}, err error

examples/redisai_tls_client/redisai_tls_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func main() {
8282

8383
// Set a tensor
8484
// AI.TENSORSET foo FLOAT 2 2 VALUES 1.1 2.2 3.3 4.4
85-
_ = client.TensorSet("foo", redisai.TypeFloat, []int{2, 2}, []float32{1.1, 2.2, 3.3, 4.4})
85+
_ = client.TensorSet("foo", redisai.TypeFloat, []int64{2, 2}, []float32{1.1, 2.2, 3.3, 4.4})
8686

8787
// Get a tensor content as a slice of values
8888
// dt DataType, shape []int, data interface{}, err error

redisai/client_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,12 @@ func TestClient_DisablePipeline(t *testing.T) {
238238

239239
// Set a tensor
240240
// AI.TENSORSET foo FLOAT 2 2 VALUES 1.1 2.2 3.3 4.4
241-
err := client.TensorSet("foo1", TypeFloat, []int{2, 2}, []float32{1.1, 2.2, 3.3, 4.4})
241+
err := client.TensorSet("foo1", TypeFloat, []int64{2, 2}, []float32{1.1, 2.2, 3.3, 4.4})
242242
if err != nil {
243243
t.Errorf("TensorSet() error = %v", err)
244244
}
245245
// AI.TENSORSET foo2 FLOAT 1" 1 VALUES 1.1
246-
err = client.TensorSet("foo2", TypeFloat, []int{1, 1}, []float32{1.1})
246+
err = client.TensorSet("foo2", TypeFloat, []int64{1, 1}, []float32{1.1})
247247
if err != nil {
248248
t.Errorf("TensorSet() error = %v", err)
249249
}

redisai/commands.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
// TensorSet sets a tensor
11-
func (c *Client) TensorSet(keyName, dt string, dims []int, data interface{}) (err error) {
11+
func (c *Client) TensorSet(keyName, dt string, dims []int64, data interface{}) (err error) {
1212
args, err := tensorSetFlatArgs(keyName, dt, dims, data)
1313
_, err = c.DoOrSend("AI.TENSORSET", args, err)
1414
return
@@ -45,7 +45,7 @@ func (c *Client) TensorGetToTensor(name, format string, tensor TensorInterface)
4545
}
4646

4747
// TensorGetValues gets a tensor's values
48-
func (c *Client) TensorGetValues(name string) (dt string, shape []int, data interface{}, err error) {
48+
func (c *Client) TensorGetValues(name string) (dt string, shape []int64, data interface{}, err error) {
4949
args := redis.Args{}.Add(name, TensorContentTypeMeta, TensorContentTypeValues)
5050
var reply interface{}
5151
reply, err = c.DoOrSend("AI.TENSORGET", args, nil)
@@ -57,7 +57,7 @@ func (c *Client) TensorGetValues(name string) (dt string, shape []int, data inte
5757
}
5858

5959
// TensorGetValues gets a tensor's values
60-
func (c *Client) TensorGetMeta(name string) (dt string, shape []int, err error) {
60+
func (c *Client) TensorGetMeta(name string) (dt string, shape []int64, err error) {
6161
args := redis.Args{}.Add(name, TensorContentTypeMeta)
6262
var reply interface{}
6363
reply, err = c.DoOrSend("AI.TENSORGET", args, nil)
@@ -69,7 +69,7 @@ func (c *Client) TensorGetMeta(name string) (dt string, shape []int, err error)
6969
}
7070

7171
// TensorGetValues gets a tensor's values
72-
func (c *Client) TensorGetBlob(name string) (dt string, shape []int, data []byte, err error) {
72+
func (c *Client) TensorGetBlob(name string) (dt string, shape []int64, data []byte, err error) {
7373
args := redis.Args{}.Add(name, TensorContentTypeMeta, TensorContentTypeBlob)
7474
var reply interface{}
7575
reply, err = c.DoOrSend("AI.TENSORGET", args, nil)

redisai/commands_test.go

Lines changed: 67 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func TestCommand_TensorSet(t *testing.T) {
1717

1818
valuesInt8 := []int8{1}
1919
valuesInt16 := []int16{1}
20-
valuesInt32 := []int{1}
20+
valuesInt32 := []int64{1}
2121
valuesInt64 := []int64{1}
2222

2323
valuesUint8 := []uint8{1}
@@ -46,12 +46,12 @@ func TestCommand_TensorSet(t *testing.T) {
4646

4747
keyError1 := "test:TestCommand_TensorSet:1:FaultyDims"
4848

49-
shp := []int{1}
49+
shp := []int64{1}
5050

5151
type args struct {
5252
name string
5353
dt string
54-
dims []int
54+
dims []int64
5555
data interface{}
5656
}
5757

@@ -78,7 +78,7 @@ func TestCommand_TensorSet(t *testing.T) {
7878

7979
{keyByte, args{keyByte, TypeUint8, shp, valuesByte}, false},
8080

81-
{keyError1, args{keyError1, TypeFloat, []int{1, 10}, []float32{1}}, true},
81+
{keyError1, args{keyError1, TypeFloat, []int64{1, 10}, []float32{1}}, true},
8282
}
8383
for _, tt := range tests {
8484
t.Run(tt.name, func(t *testing.T) {
@@ -91,7 +91,7 @@ func TestCommand_TensorSet(t *testing.T) {
9191
}
9292

9393
func TestCommand_FullFromTensor(t *testing.T) {
94-
tensor := implementations.NewAiTensorWithShape([]int{1})
94+
tensor := implementations.NewAiTensorWithShape([]int64{1})
9595
tensor.SetData([]float32{1.0})
9696
client := createTestClient()
9797
err := client.TensorSetFromTensor("tensor1", tensor)
@@ -101,7 +101,7 @@ func TestCommand_FullFromTensor(t *testing.T) {
101101
if diff := cmp.Diff(TypeFloat32, gotResp[0]); diff != "" {
102102
t.Errorf("TestCommand_FullFromTensor() mismatch (-want +got):\n%s", diff)
103103
}
104-
if diff := cmp.Diff([]int{1}, gotResp[1]); diff != "" {
104+
if diff := cmp.Diff([]int64{1}, gotResp[1]); diff != "" {
105105
t.Errorf("TestCommand_FullFromTensor() mismatch (-want +got):\n%s", diff)
106106
}
107107
if diff := cmp.Diff([]float32{1.0}, gotResp[2]); diff != "" {
@@ -149,8 +149,8 @@ func TestCommand_TensorGet(t *testing.T) {
149149
keyUint8 := "test:TensorGet:TypeUint8:1"
150150
keyUint16 := "test:TensorGet:TypeUint16:1"
151151

152-
shp := []int{1}
153-
shpByteSlice := []int{1, 5}
152+
shp := []int64{1}
153+
shpByteSlice := []int64{1, 5}
154154
simpleClient := createTestClient()
155155
simpleClient.TensorSet(keyByteSlice, TypeUint8, shpByteSlice, valuesByteSlice)
156156

@@ -173,7 +173,7 @@ func TestCommand_TensorGet(t *testing.T) {
173173
name string
174174
args args
175175
wantDt string
176-
wantShape []int
176+
wantShape []int64
177177
wantData interface{}
178178
compareDt bool
179179
compareShape bool
@@ -222,7 +222,7 @@ func TestCommand_TensorGetBlob(t *testing.T) {
222222
keyByte := "test:TensorGetBlog:[]byte:1"
223223
keyUnexistant := "test:TensorGetMeta:Unexistant"
224224

225-
shp := []int{1, 4}
225+
shp := []int64{1, 4}
226226
simpleClient := Connect("", createPool())
227227
simpleClient.TensorSet(keyByte, TypeInt8, shp, valuesByte)
228228

@@ -233,7 +233,7 @@ func TestCommand_TensorGetBlob(t *testing.T) {
233233
name string
234234
args args
235235
wantDt string
236-
wantShape []int
236+
wantShape []int64
237237
wantData []byte
238238
wantErr bool
239239
}{
@@ -279,7 +279,7 @@ func TestCommand_TensorGetMeta(t *testing.T) {
279279

280280
keyUnexistant := "test:TensorGetMeta:Unexistant"
281281

282-
shp := []int{1, 2}
282+
shp := []int64{1, 2}
283283
simpleClient := Connect("", createPool())
284284
simpleClient.TensorSet(keyFloat32, TypeFloat32, shp, nil)
285285
simpleClient.TensorSet(keyFloat64, TypeFloat64, shp, nil)
@@ -299,7 +299,7 @@ func TestCommand_TensorGetMeta(t *testing.T) {
299299
name string
300300
args args
301301
wantDt string
302-
wantShape []int
302+
wantShape []int64
303303
wantErr bool
304304
}{
305305
{keyFloat32, args{keyFloat32}, TypeFloat32, shp, false},
@@ -354,8 +354,8 @@ func TestCommand_TensorGetValues(t *testing.T) {
354354
keyUint16 := "test:TensorGetValues:TypeUint16:1"
355355
keyUnexistant := "test:TensorGetValues:Unexistant"
356356

357-
shp := []int{1}
358-
shp2 := []int{1, 5}
357+
shp := []int64{1}
358+
shp2 := []int64{1, 5}
359359
simpleClient := Connect("", createPool())
360360
simpleClient.TensorSet(keyFloat32, TypeFloat32, shp2, valuesFloat32)
361361
simpleClient.TensorSet(keyFloat64, TypeFloat64, shp, valuesFloat64)
@@ -375,7 +375,7 @@ func TestCommand_TensorGetValues(t *testing.T) {
375375
name string
376376
args args
377377
wantDt string
378-
wantShape []int
378+
wantShape []int64
379379
wantData interface{}
380380
wantErr bool
381381
}{
@@ -574,12 +574,12 @@ func TestCommand_ModelRun(t *testing.T) {
574574
return
575575
}
576576

577-
errortset := simpleClient.TensorSet(keyTransaction1, TypeFloat, []int{1, 30}, nil)
577+
errortset := simpleClient.TensorSet(keyTransaction1, TypeFloat, []int64{1, 30}, nil)
578578
if errortset != nil {
579579
t.Error(errortset)
580580
}
581581

582-
errortsetReference := simpleClient.TensorSet(keyReference1, TypeFloat, []int{256}, nil)
582+
errortsetReference := simpleClient.TensorSet(keyReference1, TypeFloat, []int64{256}, nil)
583583
if errortsetReference != nil {
584584
t.Error(errortsetReference)
585585
}
@@ -848,9 +848,9 @@ func TestCommand_Info(t *testing.T) {
848848
assert.Equal(t, BackendTF, info["backend"])
849849
assert.Equal(t, "0", info["calls"])
850850

851-
err = c.TensorSet("a", TypeFloat32, []int{1}, []float32{1.1})
851+
err = c.TensorSet("a", TypeFloat32, []int64{1}, []float32{1.1})
852852
assert.Nil(t, err)
853-
err = c.TensorSet("b", TypeFloat32, []int{1}, []float32{4.4})
853+
err = c.TensorSet("b", TypeFloat32, []int64{1}, []float32{4.4})
854854
assert.Nil(t, err)
855855
err = c.ModelRun(keyModel1, []string{"a", "b"}, []string{"mul"})
856856
assert.Nil(t, err)
@@ -878,7 +878,7 @@ func TestCommand_DagRun(t *testing.T) {
878878
return
879879
}
880880
err = c.ModelSet(keyModel1, BackendTF, DeviceCPU, data, []string{"a", "b"}, []string{"mul"})
881-
err = c.TensorSet("persisted_tensor_1", TypeFloat32, []int{1, 2}, []float32{5, 10})
881+
err = c.TensorSet("persisted_tensor_1", TypeFloat32, []int64{1, 2}, []float32{5, 10})
882882
assert.Nil(t, err)
883883

884884
type args struct {
@@ -891,12 +891,12 @@ func TestCommand_DagRun(t *testing.T) {
891891
args args
892892
wantErr bool
893893
}{
894-
{"t_wrong_number", args{[]string{"notnumber"}, nil, NewDag().TensorSet("tensor1", TypeFloat32, []int{1, 2}, []int{5, 10})}, true},
895-
{"t_load", args{[]string{"persisted_tensor_1"}, []string{"tensor1"}, NewDag().TensorSet("tensor1", TypeFloat32, []int{1, 2}, []int{5, 10})}, false},
896-
{"t_load_err", args{[]string{"not_exits_tensor"}, []string{"tensor1"}, NewDag().TensorSet("tensor1", TypeFloat32, []int{1, 2}, []int{5, 10})}, true},
897-
{"t1", args{nil, nil, NewDag().TensorSet("a", TypeFloat32, []int{1}, []float32{1.1})}, false},
898-
{"t_blob", args{nil, nil, NewDag().TensorSet("a", TypeFloat32, []int{1}, []float32{1.1}).TensorSet("b", TypeFloat32, []int{1}, []float32{4.4}).ModelRun("test:DagRun:mymodel:1", []string{"a", "b"}, []string{"mul"}).TensorGet("mul", TensorContentTypeBlob)}, false},
899-
{"t_values", args{nil, nil, NewDag().TensorSet("mytensor", TypeFloat32, []int{1, 2}, []int{5, 10}).TensorGet("mytensor", TensorContentTypeValues)}, false},
894+
{"t_wrong_number", args{[]string{"notnumber"}, nil, NewDag().TensorSet("tensor1", TypeFloat32, []int64{1, 2}, []int64{5, 10})}, true},
895+
{"t_load", args{[]string{"persisted_tensor_1"}, []string{"tensor1"}, NewDag().TensorSet("tensor1", TypeFloat32, []int64{1, 2}, []int64{5, 10})}, false},
896+
{"t_load_err", args{[]string{"not_exits_tensor"}, []string{"tensor1"}, NewDag().TensorSet("tensor1", TypeFloat32, []int64{1, 2}, []int64{5, 10})}, true},
897+
{"t1", args{nil, nil, NewDag().TensorSet("a", TypeFloat32, []int64{1}, []float32{1.1})}, false},
898+
{"t_blob", args{nil, nil, NewDag().TensorSet("a", TypeFloat32, []int64{1}, []float32{1.1}).TensorSet("b", TypeFloat32, []int64{1}, []float32{4.4}).ModelRun("test:DagRun:mymodel:1", []string{"a", "b"}, []string{"mul"}).TensorGet("mul", TensorContentTypeBlob)}, false},
899+
{"t_values", args{nil, nil, NewDag().TensorSet("mytensor", TypeFloat32, []int64{1, 2}, []int64{5, 10}).TensorGet("mytensor", TensorContentTypeValues)}, false},
900900
}
901901
for _, tt := range tests {
902902
t.Run(tt.name, func(t *testing.T) {
@@ -932,7 +932,7 @@ func TestCommand_DagRun(t *testing.T) {
932932

933933
func TestCommand_DagRunRO(t *testing.T) {
934934
c := createTestClient()
935-
err := c.TensorSet("persisted_tensor", TypeFloat32, []int{1, 2}, []float32{5, 10})
935+
err := c.TensorSet("persisted_tensor", TypeFloat32, []int64{1, 2}, []float32{5, 10})
936936
assert.Nil(t, err)
937937
type args struct {
938938
loadKeys []string
@@ -944,8 +944,8 @@ func TestCommand_DagRunRO(t *testing.T) {
944944
wantErr bool
945945
}{
946946
{"t_1", args{[]string{"persisted_tensor"}, NewDag().TensorGet("persisted_tensor", TensorContentTypeValues)}, false},
947-
{"t_2", args{nil, NewDag().TensorSet("tensor1", TypeFloat32, []int{1, 2}, []int{5, 10}).TensorSet("tensor2", TypeFloat32, []int{1, 2}, []int{5, 10})}, false},
948-
{"t_err1", args{[]string{"notnumber"}, NewDag().TensorSet("tensor1", TypeFloat32, []int{1, 2}, []int{5, 10})}, true},
947+
{"t_2", args{nil, NewDag().TensorSet("tensor1", TypeFloat32, []int64{1, 2}, []int64{5, 10}).TensorSet("tensor2", TypeFloat32, []int64{1, 2}, []int64{5, 10})}, false},
948+
{"t_err1", args{[]string{"notnumber"}, NewDag().TensorSet("tensor1", TypeFloat32, []int64{1, 2}, []int64{5, 10})}, true},
949949
}
950950
for _, tt := range tests {
951951
t.Run(tt.name, func(t *testing.T) {
@@ -978,3 +978,40 @@ func TestCommand_DagRunRO(t *testing.T) {
978978
})
979979
}
980980
}
981+
982+
func TestClient_ModelRun(t *testing.T) {
983+
type fields struct {
984+
Pool *redis.Pool
985+
PipelineActive bool
986+
PipelineAutoFlushSize uint32
987+
PipelinePos uint32
988+
ActiveConn redis.Conn
989+
}
990+
type args struct {
991+
name string
992+
inputTensorNames []string
993+
outputTensorNames []string
994+
}
995+
tests := []struct {
996+
name string
997+
fields fields
998+
args args
999+
wantErr bool
1000+
}{
1001+
// TODO: Add test cases.
1002+
}
1003+
for _, tt := range tests {
1004+
t.Run(tt.name, func(t *testing.T) {
1005+
c := &Client{
1006+
Pool: tt.fields.Pool,
1007+
PipelineActive: tt.fields.PipelineActive,
1008+
PipelineAutoFlushSize: tt.fields.PipelineAutoFlushSize,
1009+
PipelinePos: tt.fields.PipelinePos,
1010+
ActiveConn: tt.fields.ActiveConn,
1011+
}
1012+
if err := c.ModelRun(tt.args.name, tt.args.inputTensorNames, tt.args.outputTensorNames); (err != nil) != tt.wantErr {
1013+
t.Errorf("ModelRun() error = %v, wantErr %v", err, tt.wantErr)
1014+
}
1015+
})
1016+
}
1017+
}

redisai/dag.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import "github.com/gomodule/redigo/redis"
55
// DagCommandInterface is an interface that represents the skeleton of DAG supported commands
66
// needed to map it to a RedisAI DAGRUN and DAGURN_RO commands
77
type DagCommandInterface interface {
8-
TensorSet(keyName, dt string, dims []int, data interface{}) DagCommandInterface
8+
TensorSet(keyName, dt string, dims []int64, data interface{}) DagCommandInterface
99
TensorGet(name, format string) DagCommandInterface
1010
ModelRun(name string, inputTensorNames, outputTensorNames []string) DagCommandInterface
1111
FlatArgs() (redis.Args, error)
@@ -22,7 +22,7 @@ func NewDag() *Dag {
2222
}
2323
}
2424

25-
func (d *Dag) TensorSet(keyName, dt string, dims []int, data interface{}) DagCommandInterface {
25+
func (d *Dag) TensorSet(keyName, dt string, dims []int64, data interface{}) DagCommandInterface {
2626
args := redis.Args{"AI.TENSORSET"}
2727
setFlatArgs, err := tensorSetFlatArgs(keyName, dt, dims, data)
2828
if err == nil {

redisai/example_client_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func ExampleConnect() {
1919

2020
// Set a tensor
2121
// AI.TENSORSET foo FLOAT 2 2 VALUES 1.1 2.2 3.3 4.4
22-
_ = client.TensorSet("foo", redisai.TypeFloat, []int{2, 2}, []float32{1.1, 2.2, 3.3, 4.4})
22+
_ = client.TensorSet("foo", redisai.TypeFloat, []int64{2, 2}, []float32{1.1, 2.2, 3.3, 4.4})
2323

2424
// Get a tensor content as a slice of values
2525
// dt DataType, shape []int, data interface{}, err error
@@ -49,7 +49,7 @@ func ExampleConnect_pool() {
4949

5050
// Set a tensor
5151
// AI.TENSORSET foo FLOAT 2 2 VALUES 1.1 2.2 3.3 4.4
52-
_ = client.TensorSet("foo", redisai.TypeFloat, []int{2, 2}, []float32{1.1, 2.2, 3.3, 4.4})
52+
_ = client.TensorSet("foo", redisai.TypeFloat, []int64{2, 2}, []float32{1.1, 2.2, 3.3, 4.4})
5353

5454
// Get a tensor content as a slice of values
5555
// dt DataType, shape []int, data interface{}, err error
@@ -120,7 +120,7 @@ func ExampleConnect_ssl() {
120120

121121
// Set a tensor
122122
// AI.TENSORSET foo FLOAT 2 2 VALUES 1.1 2.2 3.3 4.4
123-
_ = client.TensorSet("foo", redisai.TypeFloat, []int{2, 2}, []float32{1.1, 2.2, 3.3, 4.4})
123+
_ = client.TensorSet("foo", redisai.TypeFloat, []int64{2, 2}, []float32{1.1, 2.2, 3.3, 4.4})
124124

125125
// Get a tensor content as a slice of values
126126
// dt DataType, shape []int, data interface{}, err error

0 commit comments

Comments
 (0)