<h2 dir="auto"><g-emoji class="g-emoji" alias="rocket" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f680.png">🚀</g-emoji> Feature</h2>
<p dir="auto"><code class="notranslate">torch.mean</code> currently only accepts a single dimension. It should also accept a tuple of dimensions like <code class="notranslate">torch.sum</code> does.</p>
<h2 dir="auto">Motivation</h2>
<p dir="auto">Makes code cleaner and more concise when taking the mean of some quantity across multiple dimensions. An example of this is taking the mean of some pixel-wise quantity over an image (which has two dimensions, and potentially a color channel).</p>
<h2 dir="auto">Alternatives</h2>
<p dir="auto">Current workaround is chaining <code class="notranslate">.mean</code>s repeatedly, as in <code class="notranslate">array.mean(0).mean(0).mean(0)</code> to take the mean over the first three dimensions of an array.</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> mean</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> var, std</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> max, min</li>
</ul>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/VitalyFedyunin/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/VitalyFedyunin">@VitalyFedyunin</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ngimel/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ngimel">@ngimel</a></p>