Skip to content

assert added for Shape mismatch between input and given nin value#107

Open
shusank8 wants to merge 1 commit intokarpathy:masterfrom
shusank8:master
Open

assert added for Shape mismatch between input and given nin value#107
shusank8 wants to merge 1 commit intokarpathy:masterfrom
shusank8:master

Conversation

@shusank8
Copy link

Shape mismatch between Neuron nin and given x

Example

x = [1,2,3]
neu = Neuron(2)
neu(x) => still works because zip works by looking at the min length between two iterator.

IgorTavcar added a commit to IgorTavcar/micrograd that referenced this pull request Mar 5, 2026
- Simplify backward pass: replace _backward closures with _local_grads tuples (from karpathy#115)
- Zero grads before backward for idempotent backward() calls (from karpathy#102)
- Add exp, log, tanh, softmax to Value class
- Add transformer components: Linear, Embedding, LayerNorm, Attention,
  MultiHeadAttention, FeedForward, TransformerBlock, Transformer, cross_entropy
- Move single-output unwrapping from Layer to MLP (from karpathy#111)
- Add input shape assertion in Neuron (from karpathy#107)
- Add MLP test (from karpathy#111)
- Expand .gitignore with standard Python patterns

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant