Minor changes
This commit is contained in:
parent
f54bea9559
commit
9de8cb8510
1 changed files with 1 additions and 4 deletions
|
|
@ -11,7 +11,6 @@ func Add(sum_arg1, sum_arg2 int8) (interface{}, error) {
|
|||
sum_scope := op.NewScope()
|
||||
input1 := op.Placeholder(sum_scope.SubScope("Summand1"), tf.Int8)
|
||||
input2 := op.Placeholder(sum_scope.SubScope("Summand2"), tf.Int8)
|
||||
|
||||
sum_result_node := op.Add(sum_scope, input1, input2)
|
||||
|
||||
graph, err := sum_scope.Finalize()
|
||||
|
|
@ -39,7 +38,6 @@ func Add(sum_arg1, sum_arg2 int8) (interface{}, error) {
|
|||
fmt.Println(err.Error())
|
||||
return 0, err
|
||||
}
|
||||
|
||||
defer session.Close()
|
||||
|
||||
sum, err := session.Run(
|
||||
|
|
@ -63,7 +61,6 @@ func Multiply(sum_arg1, sum_arg2 int8) (interface{}, error) {
|
|||
input2 := op.Placeholder(sum_scope.SubScope("Summand2"), tf.Int8)
|
||||
|
||||
sum_result_node := op.Mul(sum_scope, input1, input2)
|
||||
|
||||
graph, err := sum_scope.Finalize()
|
||||
|
||||
if nil != err {
|
||||
|
|
@ -89,7 +86,6 @@ func Multiply(sum_arg1, sum_arg2 int8) (interface{}, error) {
|
|||
fmt.Println(err.Error())
|
||||
return 0, err
|
||||
}
|
||||
|
||||
defer session.Close()
|
||||
|
||||
sum, err := session.Run(
|
||||
|
|
@ -114,6 +110,7 @@ func main() {
|
|||
} else {
|
||||
fmt.Println("Add:", res)
|
||||
}
|
||||
|
||||
res, err = Multiply(-1, 2)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue