-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67a7796
commit d375d1f
Showing
6 changed files
with
81 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package tanh | ||
|
||
import ( | ||
"github.com/advancedclimatesystems/gonnx/onnx" | ||
"github.com/advancedclimatesystems/gonnx/ops" | ||
"gorgonia.org/tensor" | ||
) | ||
|
||
var tanhTypeConstraint = [][]tensor.Dtype{ | ||
{tensor.Float32, tensor.Float64}, | ||
} | ||
|
||
// Tanh represents the tanh operator. | ||
type Tanh struct { | ||
ops.BaseOperator | ||
} | ||
|
||
// newTanh returns a new tanh operator. | ||
func newTanh(version int, typeConstraint [][]tensor.Dtype) *Tanh { | ||
return &Tanh{ | ||
BaseOperator: ops.NewBaseOperator( | ||
version, | ||
1, | ||
1, | ||
typeConstraint, | ||
"tanh", | ||
), | ||
} | ||
} | ||
|
||
// Init initializes the sigmoid operator. | ||
func (t *Tanh) Init(*onnx.NodeProto) error { | ||
return nil | ||
} | ||
|
||
// Apply the sigmoid operator to the input node. | ||
func (t *Tanh) Apply(inputs []tensor.Tensor) ([]tensor.Tensor, error) { | ||
out, err := ops.Tanh(inputs[0]) | ||
|
||
return []tensor.Tensor{out}, err | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters