Skip to content

Commit

Permalink
Add test for add_custom_scalar (#449)
Browse files Browse the repository at this point in the history
* add test for custom_scalars

* only do smoke test
  • Loading branch information
lanpa committed Jun 16, 2019
1 parent 35a1cda commit 097c178
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/expect/test_summary.test_custom_scalars.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
value {
tag: "custom_scalars__config__"
tensor {
dtype: DT_STRING
tensor_shape {
}
string_val: "\022(\n\006Taiwan\022\036\n\004twse\022\026\n\ttwse/0050\n\ttwse/2330\022]\n\003USA\022$\n\003dow\032\035\n\033\n\007dow/aaa\022\007dow/bbb\032\007dow/ccc\0220\n\006nasdaq\032&\n$\n\nnasdaq/aaa\022\nnasdaq/bbb\032\nnasdaq/ccc"
}
metadata {
plugin_data {
plugin_name: "custom_scalars"
}
}
}
6 changes: 6 additions & 0 deletions tests/test_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ def test_histogram_fd(self):
def test_histogram_doane(self):
compare_proto(summary.histogram('dummy', tensor_N(shape=(1024,)), bins='doane', max_bins=5), self)

def test_custom_scalars(self):
layout = {'Taiwan': {'twse': ['Multiline', ['twse/0050', 'twse/2330']]},
'USA': {'dow': ['Margin', ['dow/aaa', 'dow/bbb', 'dow/ccc']],
'nasdaq': ['Margin', ['nasdaq/aaa', 'nasdaq/bbb', 'nasdaq/ccc']]}}
summary.custom_scalars(layout) # smoke test only.

def test_mesh(self):
vertices_tensor = np.array([[
[1, 1, 1],
Expand Down

0 comments on commit 097c178

Please sign in to comment.