Skip to content

Commit c6499f6

Browse files
committed
fix v0.5 compatibility
1 parent 425d402 commit c6499f6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/layers/multinomial-logistic-loss.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function forward(backend::CPUBackend, state::MultinomialLogisticLossLayerState,
9393

9494
idx_all = map(1:length(dims)) do i
9595
if i == state.op_dim
96-
round.(Int, label) + 1
96+
map(x -> round(Int, x), label) .+ 1
9797
else
9898
dim = dims[i]
9999
reshape(1:dim, [j == i? dim : 1 for j = 1:length(dims)]...)

src/layers/softmax-loss.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function backward(backend::CPUBackend, state::SoftmaxLossLayerState, inputs::Vec
5656

5757
idx_all = map(1:length(dims)) do i
5858
if i == state.logistic.op_dim
59-
round.(Int, label) .+ 1
59+
map(x -> round(Int, x), label) .+ 1
6060
else
6161
dim = dims[i]
6262
reshape(1:dim, [j == i? dim : 1 for j = 1:length(dims)]...)

0 commit comments

Comments
 (0)