TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

LLMs all fail this NumPy indexing example

6 pointsby minihat3 months ago
When mixing basic slicing with an advanced index, NumPy moves the advanced index&#x27;s subspace to the front, so in the example, A[0, :, B] produces a shape of (4, 2) rather than (2, 4).<p><pre><code> import numpy as np A = np.random.rand(1, 2, 2) B = np.array([0, 1, 0, 1]) C = A[0, :, B] print(&quot;C.shape:&quot;, C.shape) </code></pre> So far every LLM I&#x27;ve tried (Grok 3, o1, Gemini Pro) all predict (2, 4) and can&#x27;t be persuaded otherwise.

1 comment

dekhn3 months ago
So what?
评论 #43094020 未加载