提交 6bb84b96 编写于 作者: D dongzhihong

"remove unused debug info"

上级 42dcffc2
......@@ -2,6 +2,7 @@ package pserver
import (
"io/ioutil"
"reflect"
"testing"
)
......@@ -22,3 +23,26 @@ func TestOptimizerCreateRelease(t *testing.T) {
o := newOptimizer(param)
o.Cleanup()
}
func TestOptimizerFull(t *testing.T) {
p := Parameter{
Name: "a",
ElementType: Float32,
}
p.Content = []byte{1, 3}
config, err := ioutil.ReadFile("./cclient/test/testdata/optimizer.pb.txt")
if err != nil {
t.Fatalf("read optimizer proto failed")
}
param := ParameterWithConfig{
Param: p,
Config: config,
}
o := newOptimizer(param)
g := Gradient(p)
if !reflect.DeepEqual(p.Content, o.GetWeights()) {
t.FailNow()
}
o.UpdateParameter(g)
o.Cleanup()
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册