Skip to content

Commit 52df7a9

Browse files
committed
feat: check for size
1 parent 31f099d commit 52df7a9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/TracedRArray.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1416,7 +1416,9 @@ function unwrapped_broadcast(f::F, x::Slices, original_dims) where {F}
14161416
end
14171417

14181418
function unwrapped_broadcast(f::F, xs, original_dims) where {F}
1419-
return reshape(unrolled_map(f, xs), size(xs)), original_dims, identity
1419+
mapped_xs = unrolled_map(f, xs)
1420+
applicable(size, xs) && (mapped_xs = reshape(mapped_xs, size(xs)))
1421+
return mapped_xs, original_dims, identity
14201422
end
14211423

14221424
# TODO: once traced_call supports internal mutations, we can use traced_call here

0 commit comments

Comments
 (0)