Skip to content

Commit

Permalink
fix const value name
Browse files Browse the repository at this point in the history
Signed-off-by: datelier <57349093+datelier@users.noreply.github.com>
  • Loading branch information
datelier committed Apr 23, 2020
1 parent f49d3a8 commit 4eeda50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/core/converter/tensorflow/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func WithFetches(operationNames []string, outputIndexes []int) Option {
}
}

func WithNdim(ndim int8) Option {
func WithNdim(ndim uint8) Option {
return func(t *tensorflow) {
t.ndim = ndim
}
Expand Down
10 changes: 5 additions & 5 deletions internal/core/converter/tensorflow/tensorflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type tensorflow struct {
options *SessionOptions
graph *tf.Graph
session *tf.Session
ndim int8
ndim uint8
}

type OutputSpec struct {
Expand All @@ -52,8 +52,8 @@ type OutputSpec struct {
}

const (
TWO_DIM int8 = 2
THREE_DIM int8 = 3
TwoDim uint8 = iota + 2
ThreeDim
)

func New(opts ...Option) (TF, error) {
Expand Down Expand Up @@ -114,7 +114,7 @@ func (t *tensorflow) GetVector(inputs ...string) ([]float64, error) {
}

switch t.ndim {
case TWO_DIM:
case TwoDim:
value, ok := tensors[0].Value().([][]float64)
if ok {
if value == nil {
Expand All @@ -124,7 +124,7 @@ func (t *tensorflow) GetVector(inputs ...string) ([]float64, error) {
} else {
return nil, errors.ErrFailedToCastTF(tensors[0].Value())
}
case THREE_DIM:
case ThreeDim:
value, ok := tensors[0].Value().([][][]float64)
if ok {
if value == nil || value[0] == nil {
Expand Down

0 comments on commit 4eeda50

Please sign in to comment.