forked from rai-project/mxnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraph_test.go
More file actions
36 lines (28 loc) · 776 Bytes
/
graph_test.go
File metadata and controls
36 lines (28 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package mxnet
import (
"encoding/json"
"testing"
rice "github.com/GeertJohan/go.rice"
"github.com/stretchr/testify/assert"
)
var (
fixturesBox = rice.MustFindBox("_fixtures")
inceptionSymbolJSON = fixturesBox.MustBytes("Inception-BN-symbol.json")
caffenetSymbolJSON = fixturesBox.MustBytes("caffenet-symbol.json")
rn101 = fixturesBox.MustBytes("RN101-5k500-symbol.json")
)
func TestUnmarshalGraph(t *testing.T) {
var g Graph
err := json.Unmarshal(rn101, &g)
assert.NoError(t, err)
assert.NotEmpty(t, g)
s, err := json.MarshalIndent(g, "", " ")
assert.NoError(t, err)
assert.NotEmpty(t, s)
// t.Log(string(s))
dg, err := g.ToDotGraph()
assert.NoError(t, err)
assert.NotNil(t, dg)
assert.NotEmpty(t, dg)
t.Log(dg.String())
}