# Julia's Broadcast vs Jax's vmap

**URL:** <https://discourse.julialang.org/t/julias-broadcast-vs-jaxs-vmap/38990>\
**Category:** Internals & Design\
**Created:** [May 7, 2020, 10:12pm UTC](https://discourse.julialang.org/t/julias-broadcast-vs-jaxs-vmap/38990 "2020-05-07T22:12:37Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [May 8, 2020, 7:01pm UTC](https://discourse.julialang.org/t/julias-broadcast-vs-jaxs-vmap/38990/12 "2020-05-08T19:01:48Z")

</div>

I definitely really like being able to explicitly annotate the broadcasted dimensions — there’s a great usefulness to Julia’s broadcast permissiveness, but it’d be really cool to have an explicit mode like Jax.

We do need a dedicated struct for each slice. Once we have that, we could totally add a broadcast “rule” that transformed broadcasted dot over eachslice and a 0-dim container like ref to be a matvec. It’s quite the tiny peephole, but I think it could be reasonable if that’s causing major issues.

We also need to implement better broadcasting over generators like the sort that each slice currently returns in any case.

The `mean` performance issue looks to be a exasperated by a performance issue with `mean` itself, I think.

Thanks for putting this all together!

---

_[View the full topic](https://discourse.julialang.org/t/julias-broadcast-vs-jaxs-vmap/38990)._
