Skip to content
Snippets Groups Projects
Commit dd90b19e authored by MORITA Kazutaka's avatar MORITA Kazutaka Committed by Tianqi Chen
Browse files

add sanity check to input shape type (#469)

parent 42d81cca
No related branches found
No related tags found
No related merge requests found
......@@ -241,6 +241,10 @@ def build(graph, target=None, shape=None, dtype="float32",
shape = shape if shape else {}
if not isinstance(shape, dict):
raise TypeError("require shape to be dict")
for value in shape.values():
if not all(isinstance(x, int) for x in value):
raise TypeError("shape value must be int iterator")
cfg = BuildConfig.current
graph = graph if isinstance(graph, _graph.Graph) else _graph.create(graph)
shape, dtype = _update_shape_dtype(shape, dtype, params)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment