Skip to content

Commit cdaf614

Browse files
authored
Merge pull request #42 from lorenzoh/lorenzoh/fix-offset-onehot
Fixes `OneHot` for offset masks
2 parents 2fe1cca + ba8f755 commit cdaf614

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/preprocessing.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ struct OneHot{T} <: Transform end
201201
OneHot() = OneHot{Float32}()
202202

203203
function apply(tfm::OneHot{T}, item::MaskMulti; randstate = nothing) where T
204-
mask = itemdata(item)
204+
mask = parent(itemdata(item))
205205
a = zeros(T, size(mask)..., length(item.classes))
206206
for I in CartesianIndices(mask)
207207
a[I, mask[I]] = one(T)
@@ -212,7 +212,7 @@ end
212212

213213

214214
function apply!(buf, tfm::OneHot{T}, item::MaskMulti; randstate = nothing) where T
215-
mask = itemdata(item)
215+
mask = parent(itemdata(item))
216216
a = itemdata(buf)
217217
fill!(a, zero(T))
218218

0 commit comments

Comments
 (0)