Skip to content

Commit f4b65bf

Browse files
conorbronsdonmodularbot
authored andcommitted
[Edu] Add missing ops import to GPU puzzle 18 starter scaffold
The `problems/p18/p18.py` starter scaffold imported only `DeviceRef, Graph, TensorType` from `max.graph`, omitting `ops`. The puzzle's tips and solution instruct learners to complete the graph definition with `output = ops.custom(...)`, so following the documented workflow raises `NameError: name 'ops' is not defined` before the graph is ever built. Sibling puzzles 17 and 19 already import `ops`; add it to puzzle 18 so the starter scaffold matches the documented steps. The import line sits inside the doc-included anchor, so the rendered "Code to complete" snippet is corrected as well. Found while investigating a reported puzzle 18 compile failure. That report is a different bug — a kernel elaboration error from `TileTensor` mutability drift in `problems/p18/op/softmax.mojo`, addressed separately by the skeleton resync work. This PR fixes the adjacent starter-scaffold paper cut, which the `*.mojo`-only skeleton sync check does not cover. MODULAR_ORIG_COMMIT_REV_ID: 4a717262be189a0ba6c7d70cddcc467b176b358a
1 parent f82c264 commit f4b65bf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

problems/p18/p18.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from max.driver import CPU, Accelerator, Buffer, Device
1111
from max.dtype import DType
1212
from max.engine import InferenceSession
13-
from max.graph import DeviceRef, Graph, TensorType
13+
from max.graph import DeviceRef, Graph, TensorType, ops # noqa: F401
1414
from numpy.typing import NDArray
1515
from scipy.special import softmax as scipy_softmax
1616

0 commit comments

Comments
 (0)