Skip to content

Commit

Permalink
Do not export rnn specific constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Swopper050 committed Dec 14, 2023
1 parent 180c0d8 commit 424ae23
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions ops/opset13/rnn.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ const (
type RNNDirection string

const (
Forward RNNDirection = "forward"
Reverse RNNDirection = "reverse"
Bidirectional RNNDirection = "bidirectional"
forward RNNDirection = "forward"
reverse RNNDirection = "reverse"
bidirectional RNNDirection = "bidirectional"
)

// RNN represents the ONNX rnn operator.
Expand All @@ -35,7 +35,7 @@ type RNN struct {
func newRNN() ops.Operator {
return &RNN{
activations: []string{"tanh"},
direction: Forward,
direction: forward,
}
}

Expand All @@ -58,7 +58,7 @@ func (r *RNN) Init(attributes []*onnx.AttributeProto) error {
return ops.ErrUnsupportedAttribute(attr.GetName(), r)
case "direction":
r.direction = RNNDirection(attr.GetS())
if r.direction != Forward {
if r.direction != forward {
return ops.ErrUnsupportedAttribute(attr.GetName(), r)
}
case "hidden_size":
Expand Down
12 changes: 6 additions & 6 deletions ops/opset13/rnn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestRNN(t *testing.T) {
activationAlpha: []float32{},
activationBeta: []float32{},
activations: []string{"tanh"},
direction: Forward,
direction: forward,
hiddenSize: 4,
},
rnnInput0,
Expand All @@ -58,7 +58,7 @@ func TestRNN(t *testing.T) {
activationAlpha: []float32{},
activationBeta: []float32{},
activations: []string{"sigmoid"},
direction: Forward,
direction: forward,
hiddenSize: 4,
},
rnnInput0,
Expand All @@ -70,7 +70,7 @@ func TestRNN(t *testing.T) {
activationAlpha: []float32{},
activationBeta: []float32{},
activations: []string{"relu"},
direction: Forward,
direction: forward,
hiddenSize: 4,
},
rnnInput0,
Expand All @@ -82,7 +82,7 @@ func TestRNN(t *testing.T) {
activationAlpha: []float32{},
activationBeta: []float32{},
activations: []string{"tanh"},
direction: Forward,
direction: forward,
hiddenSize: 10,
},
rnnInput1,
Expand All @@ -94,7 +94,7 @@ func TestRNN(t *testing.T) {
activationAlpha: []float32{},
activationBeta: []float32{},
activations: []string{"tanh"},
direction: Forward,
direction: forward,
hiddenSize: 4,
},
rnnInputNoB,
Expand All @@ -107,7 +107,7 @@ func TestRNN(t *testing.T) {
activationAlpha: []float32{},
activationBeta: []float32{},
activations: []string{"tanh"},
direction: Forward,
direction: forward,
hiddenSize: 4,
},
rnnInputNoBNoH,
Expand Down

0 comments on commit 424ae23

Please sign in to comment.