Skip to content

Commit

Permalink
fix data type undetermined problem
Browse files Browse the repository at this point in the history
  • Loading branch information
TE-WoodyLi committed May 30, 2018
1 parent 2fdcad0 commit 22ba80a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion build-tools/code_generator/functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,9 @@ Neural Network Layer:
x0:
doc: Indices with shape :math:`(I_0, ..., I_N)`
template: TI
x1:
w:
doc: Weights with shape :math:`(W_0, ..., W_M)`
parameter: true
outputs:
y:
doc: Output with shape :math:`(I_0, ..., I_N, W_1, ..., W_M)`
Expand Down
9 changes: 7 additions & 2 deletions python/src/nnabla/utils/cli/forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,13 @@ class ForwardConfig:
inputs = []
for e in config.executors:
for v, d in e.dataset_assign.items():
data = np.fromfile(args.inputs[input_file_index], np.float32).reshape(
v.variable_instance.d.shape)
input_filename = args.inputs[input_file_index]
if "int32" in input_filename:
data = np.fromfile(input_filename, np.int32).reshape(
v.variable_instance.d.shape)
else:
data = np.fromfile(input_filename, np.float).reshape(
v.variable_instance.d.shape)
inputs.append((d, data))
input_file_index += 1
data = []
Expand Down

0 comments on commit 22ba80a

Please sign in to comment.