I’m having a bit of a moment. What is wrong with
julia> x = [[1, 2, 3], [4, 5, 6]]
2-element Vector{Vector{Int64}}:
[1, 2, 3]
[4, 5, 6]
julia> x .- [1, 2, 3]
ERROR: DimensionMismatch: arrays could not be broadcast to a common size; got a dimension with lengths 2 and 3
Stacktrace:
[1] _bcs1
@ ./broadcast.jl:516 [inlined]
[2] _bcs
@ ./broadcast.jl:510 [inlined]
[3] broadcast_shape
@ ./broadcast.jl:504 [inlined]
[4] combine_axes
@ ./broadcast.jl:499 [inlined]
[5] instantiate
@ ./broadcast.jl:281 [inlined]
[6] materialize(bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Nothing, typeof(-), Tuple{Vector{Vector{Int64}}, Vector{Int64}}})
@ Base.Broadcast ./broadcast.jl:860
[7] top-level scope
@ REPL[18]:1
? I would like to see
[[0, 0, 0], [3, 3, 3]]
but I’m obviously doing something silly.