task_id stringlengths 9 9 | category stringclasses 5
values | prompt stringlengths 20 194 | input_data stringclasses 6
values | expected_output stringlengths 51 7.9k |
|---|---|---|---|---|
torch-000 | tensor_ops | Reshape `x` to shape (4, 6) in row-major order. | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [[-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197], [-1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012], [0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.913043498... |
torch-001 | tensor_ops | Return the transpose of `m` as a contiguous tensor. | {"m": "{\"data\": [[-1.0, -0.9428571462631226, -0.8857142925262451, -0.8285714387893677, -0.7714285850524902, -0.7142857313156128], [-0.6571428775787354, -0.6000000238418579, -0.5428571701049805, -0.48571425676345825, -0.4285714030265808, -0.37142854928970337], [-0.3142856955528259, -0.2571428418159485, -0.199999988079... | {"data": [[-1.0, -0.6571428775787354, -0.3142856955528259, 0.02857142686843872, 0.37142854928970337, 0.7142857313156128], [-0.9428571462631226, -0.6000000238418579, -0.2571428418159485, 0.08571428060531616, 0.4285714030265808, 0.7714285850524902], [-0.8857142925262451, -0.5428571701049805, -0.19999998807907104, 0.14285... |
torch-002 | tensor_ops | Return the row-wise sum of `b` as a 1-D tensor. | {"b": "{\"data\": [[0.0, 0.10000000149011612, 0.20000000298023224, 0.30000001192092896, 0.4000000059604645], [0.5, 0.6000000238418579, 0.699999988079071, 0.800000011920929, 0.9000000357627869], [1.0, 1.100000023841858, 1.2000000476837158, 1.3000000715255737, 1.399999976158142], [1.5, 1.600000023841858, 1.70000004768371... | {"data": [1.0, 3.5, 6.0, 8.5, 11.0, 13.5, 16.0, 18.5], "dtype": "float32", "shape": [8]} |
torch-003 | tensor_ops | Return the column-wise mean of `b`. | {"b": "{\"data\": [[0.0, 0.10000000149011612, 0.20000000298023224, 0.30000001192092896, 0.4000000059604645], [0.5, 0.6000000238418579, 0.699999988079071, 0.800000011920929, 0.9000000357627869], [1.0, 1.100000023841858, 1.2000000476837158, 1.3000000715255737, 1.399999976158142], [1.5, 1.600000023841858, 1.70000004768371... | {"data": [1.75, 1.8500001430511475, 1.9499999284744263, 2.0500001907348633, 2.1500000953674316], "dtype": "float32", "shape": [5]} |
torch-004 | tensor_ops | Clamp `x` to the range [-1, 1]. | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.9130434989929199, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], "dtype": "float32", "shape": [24]} |
torch-005 | tensor_ops | Return the elements of `x` that are strictly positive, in order. | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.9130434989929199, 1.1739130020141602, 1.43478262424469, 1.6956522464752197, 1.95652174949646, 2.2173912525177, 2.4782609939575195, 2.7391304969787598, 3.0], "dtype": "float32", "shape": [12]} |
torch-006 | tensor_ops | Return `x` sorted in descending order (values only). | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [3.0, 2.7391304969787598, 2.4782609939575195, 2.2173912525177, 1.95652174949646, 1.6956522464752197, 1.43478262424469, 1.1739130020141602, 0.9130434989929199, 0.6521739959716797, 0.39130449295043945, 0.13043475151062012, -0.13043475151062012, -0.39130449295043945, -0.6521739959716797, -0.9130434989929199, -1.1... |
torch-007 | tensor_ops | Return the indices that sort `x` ascending, as int64. | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23], "dtype": "int64", "shape": [24]} |
torch-008 | tensor_ops | Concatenate `b` with itself along dim 0. | {"b": "{\"data\": [[0.0, 0.10000000149011612, 0.20000000298023224, 0.30000001192092896, 0.4000000059604645], [0.5, 0.6000000238418579, 0.699999988079071, 0.800000011920929, 0.9000000357627869], [1.0, 1.100000023841858, 1.2000000476837158, 1.3000000715255737, 1.399999976158142], [1.5, 1.600000023841858, 1.70000004768371... | {"data": [[0.0, 0.10000000149011612, 0.20000000298023224, 0.30000001192092896, 0.4000000059604645], [0.5, 0.6000000238418579, 0.699999988079071, 0.800000011920929, 0.9000000357627869], [1.0, 1.100000023841858, 1.2000000476837158, 1.3000000715255737, 1.399999976158142], [1.5, 1.600000023841858, 1.7000000476837158, 1.800... |
torch-009 | tensor_ops | Stack `b` with itself along a NEW leading dimension. | {"b": "{\"data\": [[0.0, 0.10000000149011612, 0.20000000298023224, 0.30000001192092896, 0.4000000059604645], [0.5, 0.6000000238418579, 0.699999988079071, 0.800000011920929, 0.9000000357627869], [1.0, 1.100000023841858, 1.2000000476837158, 1.3000000715255737, 1.399999976158142], [1.5, 1.600000023841858, 1.70000004768371... | {"data": [[[0.0, 0.10000000149011612, 0.20000000298023224, 0.30000001192092896, 0.4000000059604645], [0.5, 0.6000000238418579, 0.699999988079071, 0.800000011920929, 0.9000000357627869], [1.0, 1.100000023841858, 1.2000000476837158, 1.3000000715255737, 1.399999976158142], [1.5, 1.600000023841858, 1.7000000476837158, 1.80... |
torch-010 | tensor_ops | Return the matrix product of `m` with itself. | {"m": "{\"data\": [[-1.0, -0.9428571462631226, -0.8857142925262451, -0.8285714387893677, -0.7714285850524902, -0.7142857313156128], [-0.6571428775787354, -0.6000000238418579, -0.5428571701049805, -0.48571425676345825, -0.4285714030265808, -0.37142854928970337], [-0.3142856955528259, -0.2571428418159485, -0.199999988079... | {"data": [[1.077551007270813, 0.7836735844612122, 0.489795982837677, 0.19591835141181946, -0.09795932471752167, -0.3918367624282837], [0.7836736440658569, 0.6073469519615173, 0.43102046847343445, 0.2546938359737396, 0.07836739718914032, -0.09795913100242615], [0.4897959232330322, 0.4310203790664673, 0.3722448945045471,... |
torch-011 | tensor_ops | Normalise each row of `b` to unit L2 norm. | {"b": "{\"data\": [[0.0, 0.10000000149011612, 0.20000000298023224, 0.30000001192092896, 0.4000000059604645], [0.5, 0.6000000238418579, 0.699999988079071, 0.800000011920929, 0.9000000357627869], [1.0, 1.100000023841858, 1.2000000476837158, 1.3000000715255737, 1.399999976158142], [1.5, 1.600000023841858, 1.70000004768371... | {"data": [[0.0, 0.18257418274879456, 0.3651483654975891, 0.547722578048706, 0.7302967309951782], [0.31311213970184326, 0.3757345974445343, 0.43835699558258057, 0.5009794235229492, 0.5636018514633179], [0.37011659145355225, 0.407128244638443, 0.44413992762565613, 0.4811515808105469, 0.5181632041931152], [0.3932418823242... |
torch-012 | tensor_ops | Add a leading batch dimension to `x` so its shape becomes (1, 24). | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [[-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.9130434989929... |
torch-013 | tensor_ops | Return the cumulative sum of `x` along dim 0. | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [-3.0, -5.73913049697876, -8.217391967773438, -10.434782981872559, -12.391304016113281, -14.086956977844238, -15.52173900604248, -16.69565200805664, -17.60869598388672, -18.2608699798584, -18.65217399597168, -18.782609939575195, -18.65217399597168, -18.2608699798584, -17.60869598388672, -16.69565200805664, -15... |
torch-014 | tensor_ops | Cast `x` to float64. | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304349899291... |
torch-015 | tensor_ops | Return the pairwise maximum of `x` and its own reverse. | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [3.0, 2.7391304969787598, 2.4782609939575195, 2.2173912525177, 1.95652174949646, 1.6956522464752197, 1.43478262424469, 1.1739130020141602, 0.9130434989929199, 0.6521739959716797, 0.39130449295043945, 0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.9130434989929199, 1.173913... |
torch-016 | autograd | Treat `x` as a leaf requiring grad, compute y = (x**2).sum(), backward, and return x.grad. | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [-6.0, -5.4782609939575195, -4.956521987915039, -4.4347825050354, -3.91304349899292, -3.3913044929504395, -2.86956524848938, -2.3478260040283203, -1.8260869979858398, -1.3043479919433594, -0.7826089859008789, -0.26086950302124023, 0.26086950302124023, 0.7826089859008789, 1.3043479919433594, 1.8260869979858398,... |
torch-017 | autograd | With `x` requiring grad, compute y = (x.sin() * x).sum(), backward, and return x.grad. | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [2.828857421875, 2.128587245941162, 1.3369883298873901, 0.5377766489982605, -0.19042092561721802, -0.7810530662536621, -1.18531334400177, -1.3760414123535156, -1.349548101425171, -1.1252415180206299, -0.743121325969696, -0.2593919634819031, 0.2593919634819031, 0.743121325969696, 1.1252415180206299, 1.349548101... |
torch-018 | autograd | With `b` requiring grad, compute the mean of b.exp() clamped to a max of 10, backward, and return b.grad. | {"b": "{\"data\": [[0.0, 0.10000000149011612, 0.20000000298023224, 0.30000001192092896, 0.4000000059604645], [0.5, 0.6000000238418579, 0.699999988079071, 0.800000011920929, 0.9000000357627869], [1.0, 1.100000023841858, 1.2000000476837158, 1.3000000715255737, 1.399999976158142], [1.5, 1.600000023841858, 1.70000004768371... | {"data": [[0.02500000037252903, 0.027629274874925613, 0.030535070225596428, 0.033746469765901566, 0.0372956208884716], [0.04121803119778633, 0.045552972704172134, 0.050343818962574005, 0.055638521909713745, 0.06149008497595787], [0.06795704364776611, 0.07510415464639664, 0.08300292491912842, 0.09173242747783661, 0.1013... |
torch-019 | autograd | Return the gradient of (x**3).sum() with respect to x, using torch.autograd.grad rather than backward. | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [27.0, 22.508506774902344, 18.42533302307129, 14.750471115112305, 11.483932495117188, 8.625709533691406, 6.175803184509277, 4.134215354919434, 2.5009453296661377, 1.275992751121521, 0.4593576192855835, 0.0510396733880043, 0.0510396733880043, 0.4593576192855835, 1.275992751121521, 2.5009453296661377, 4.13421535... |
torch-020 | autograd | With `x` requiring grad, compute y = (x**2).sum() but DETACH x before squaring, then return a tensor of zeros shaped like x if no gradient flows (i.e. return the grad, or zeros when it is None). | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], "dtype": "float32", "shape": [24]} |
torch-021 | autograd | Compute the second derivative of (x**3).sum() with respect to x (create_graph=True), returning d2y/dx2. | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [-18.0, -16.434783935546875, -14.869565963745117, -13.30434799194336, -11.739130020141602, -10.173913955688477, -8.608695983886719, -7.043478012084961, -5.4782609939575195, -3.913043975830078, -2.3478269577026367, -0.7826085090637207, 0.7826085090637207, 2.3478269577026367, 3.913043975830078, 5.478260993957519... |
torch-022 | nn_modules | Apply a Linear(5, 3) layer to `b` whose weight is arange(15).reshape(3,5)/10 (float32) and whose bias is tensor([0.1, 0.2, 0.3]). Return the output. | {"b": "{\"data\": [[0.0, 0.10000000149011612, 0.20000000298023224, 0.30000001192092896, 0.4000000059604645], [0.5, 0.6000000238418579, 0.699999988079071, 0.800000011920929, 0.9000000357627869], [1.0, 1.100000023841858, 1.2000000476837158, 1.3000000715255737, 1.399999976158142], [1.5, 1.600000023841858, 1.70000004768371... | {"data": [[0.4000000059604645, 0.9999999403953552, 1.5999999046325684], [0.9000000357627869, 2.75, 4.600000381469727], [1.4000000953674316, 4.5, 7.600000381469727], [1.899999976158142, 6.25, 10.600000381469727], [2.4000000953674316, 8.0, 13.600001335144043], [2.9000000953674316, 9.75, 16.600000381469727], [3.4000000953... |
torch-023 | nn_modules | Apply torch.nn.functional.relu to `x`. | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.9130434989929199, 1.1739130020141602, 1.43478262424469, 1.6956522464752197, 1.95652174949646, 2.2173912525177, 2.4782609939575195, 2.7391304969787598, 3.0], "dtype": "float32", "shape": ... |
torch-024 | nn_modules | Apply torch.nn.functional.gelu to `x` with the default approximation. | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [-0.004049867391586304, -0.0084369583055377, -0.016359606757760048, -0.029487209394574165, -0.04930786415934563, -0.07626339793205261, -0.10857655107975006, -0.1411219835281372, -0.1649046540260315, -0.16770288348197937, -0.13609030842781067, -0.05844927206635475, 0.07198548316955566, 0.2552141845226288, 0.484... |
torch-025 | nn_modules | Apply softmax along dim 1 to `l`. | {"l": "{\"data\": [[-2.0, -1.6363636255264282, -1.2727272510528564, -0.9090908765792847], [-0.5454545021057129, -0.1818181276321411, 0.1818181276321411, 0.5454545021057129], [0.9090908765792847, 1.2727272510528564, 1.6363636255264282, 2.0]], \"dtype\": \"float32\", \"shape\": [3, 4]}"} | {"data": [[0.13360126316547394, 0.19219224154949188, 0.2764783501625061, 0.39772820472717285], [0.13360127806663513, 0.19219225645065308, 0.2764783203601837, 0.39772817492485046], [0.13360126316547394, 0.19219224154949188, 0.2764783501625061, 0.39772820472717285]], "dtype": "float32", "shape": [3, 4]} |
torch-026 | nn_modules | Apply log_softmax along dim 1 to `l`. | {"l": "{\"data\": [[-2.0, -1.6363636255264282, -1.2727272510528564, -0.9090908765792847], [-0.5454545021057129, -0.1818181276321411, 0.1818181276321411, 0.5454545021057129], [0.9090908765792847, 1.2727272510528564, 1.6363636255264282, 2.0]], \"dtype\": \"float32\", \"shape\": [3, 4]}"} | {"data": [[-2.0128955841064453, -1.649259090423584, -1.2856228351593018, -0.9219864010810852], [-2.0128955841064453, -1.649259090423584, -1.2856228351593018, -0.9219865202903748], [-2.0128955841064453, -1.649259090423584, -1.2856228351593018, -0.9219864010810852]], "dtype": "float32", "shape": [3, 4]} |
torch-027 | nn_modules | Apply LayerNorm over the last dimension of `b` with eps=1e-5, no learnable affine parameters. | {"b": "{\"data\": [[0.0, 0.10000000149011612, 0.20000000298023224, 0.30000001192092896, 0.4000000059604645], [0.5, 0.6000000238418579, 0.699999988079071, 0.800000011920929, 0.9000000357627869], [1.0, 1.100000023841858, 1.2000000476837158, 1.3000000715255737, 1.399999976158142], [1.5, 1.600000023841858, 1.70000004768371... | {"data": [[-1.4138602018356323, -0.7069301009178162, 0.0, 0.7069301009178162, 1.4138602018356323], [-1.4138604402542114, -0.7069302201271057, -4.213631541460927e-07, 0.7069298028945923, 1.4138600826263428], [-1.4138604402542114, -0.7069302201271057, 0.0, 0.7069302201271057, 1.4138596057891846], [-1.4138604402542114, -0... |
torch-028 | nn_modules | Apply 2x2 max pooling with stride 2 to the NCHW batch `i`. | {"i": "{\"data\": [[[[-2.0, -1.9895561933517456, -1.9791122674942017, -1.9686684608459473, -1.9582245349884033, -1.947780728340149, -1.937336802482605, -1.9268929958343506], [-1.9164490699768066, -1.9060052633285522, -1.8955613374710083, -1.885117530822754, -1.87467360496521, -1.8642297983169556, -1.8537858724594116, -... | {"data": [[[[-1.9060052633285522, -1.885117530822754, -1.8642297983169556, -1.8433420658111572], [-1.7389034032821655, -1.7180156707763672, -1.6971279382705688, -1.6762402057647705], [-1.5718015432357788, -1.5509138107299805, -1.5300260782241821, -1.5091383457183838], [-1.4046998023986816, -1.3838119506835938, -1.36292... |
torch-029 | nn_modules | Apply 2x2 average pooling with stride 2 to the NCHW batch `i`. | {"i": "{\"data\": [[[[-2.0, -1.9895561933517456, -1.9791122674942017, -1.9686684608459473, -1.9582245349884033, -1.947780728340149, -1.937336802482605, -1.9268929958343506], [-1.9164490699768066, -1.9060052633285522, -1.8955613374710083, -1.885117530822754, -1.87467360496521, -1.8642297983169556, -1.8537858724594116, -... | {"data": [[[[-1.953002691268921, -1.932114839553833, -1.9112271070480347, -1.8903393745422363], [-1.7859008312225342, -1.7650129795074463, -1.744125247001648, -1.7232375144958496], [-1.6187989711761475, -1.5979112386703491, -1.5770235061645508, -1.556135654449463], [-1.4516971111297607, -1.4308093786239624, -1.40992164... |
torch-030 | nn_modules | Apply a Conv2d(3, 2, kernel_size=3) to `i` with weight filled with 0.01 and bias filled with zero, no padding. Return the output. | {"i": "{\"data\": [[[[-2.0, -1.9895561933517456, -1.9791122674942017, -1.9686684608459473, -1.9582245349884033, -1.947780728340149, -1.937336802482605, -1.9268929958343506], [-1.9164490699768066, -1.9060052633285522, -1.8955613374710083, -1.885117530822754, -1.87467360496521, -1.8642297983169556, -1.8537858724594116, -... | {"data": [[[[-0.3341514468193054, -0.3313315808773041, -0.32851171493530273, -0.3256918787956238, -0.3228720426559448, -0.32005223631858826], [-0.311592698097229, -0.3087728023529053, -0.3059529960155487, -0.30313315987586975, -0.3003133237361908, -0.29749348759651184], [-0.2890339195728302, -0.28621408343315125, -0.28... |
torch-031 | nn_modules | Flatten `i` from dim 1 onward. | {"i": "{\"data\": [[[[-2.0, -1.9895561933517456, -1.9791122674942017, -1.9686684608459473, -1.9582245349884033, -1.947780728340149, -1.937336802482605, -1.9268929958343506], [-1.9164490699768066, -1.9060052633285522, -1.8955613374710083, -1.885117530822754, -1.87467360496521, -1.8642297983169556, -1.8537858724594116, -... | {"data": [[-2.0, -1.9895561933517456, -1.9791122674942017, -1.9686684608459473, -1.9582245349884033, -1.947780728340149, -1.937336802482605, -1.9268929958343506, -1.9164490699768066, -1.9060052633285522, -1.8955613374710083, -1.885117530822754, -1.87467360496521, -1.8642297983169556, -1.8537858724594116, -1.84334206581... |
torch-032 | nn_modules | Apply an Embedding(5, 4) to the index tensor `s`, where the embedding weight is arange(20).reshape(5,4) as float32. Return the output. | {"s": "{\"data\": [[0, 1, 2, 3, 4, 0], [1, 2, 3, 4, 0, 1], [2, 3, 4, 0, 1, 2], [3, 4, 0, 1, 2, 3]], \"dtype\": \"int64\", \"shape\": [4, 6]}"} | {"data": [[[0.0, 1.0, 2.0, 3.0], [4.0, 5.0, 6.0, 7.0], [8.0, 9.0, 10.0, 11.0], [12.0, 13.0, 14.0, 15.0], [16.0, 17.0, 18.0, 19.0], [0.0, 1.0, 2.0, 3.0]], [[4.0, 5.0, 6.0, 7.0], [8.0, 9.0, 10.0, 11.0], [12.0, 13.0, 14.0, 15.0], [16.0, 17.0, 18.0, 19.0], [0.0, 1.0, 2.0, 3.0], [4.0, 5.0, 6.0, 7.0]], [[8.0, 9.0, 10.0, 11.0... |
torch-033 | nn_modules | Apply sigmoid to `x`. | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [0.04742587357759476, 0.06070346012711525, 0.07739628106355667, 0.09819959104061127, 0.1238439679145813, 0.15503396093845367, 0.19235458970069885, 0.2361484318971634, 0.2863774299621582, 0.3424997925758362, 0.40340331196784973, 0.4674374461174011, 0.5325625538825989, 0.5965967178344727, 0.657500147819519, 0.71... |
torch-034 | losses | Return the mean-squared-error between `b` and a tensor of zeros of the same shape, as a 1-element tensor. | {"b": "{\"data\": [[0.0, 0.10000000149011612, 0.20000000298023224, 0.30000001192092896, 0.4000000059604645], [0.5, 0.6000000238418579, 0.699999988079071, 0.800000011920929, 0.9000000357627869], [1.0, 1.100000023841858, 1.2000000476837158, 1.3000000715255737, 1.399999976158142], [1.5, 1.600000023841858, 1.70000004768371... | {"data": [5.135000705718994], "dtype": "float32", "shape": [1]} |
torch-035 | losses | Return the cross-entropy loss of logits `l` against class targets [0, 3, 1] with mean reduction, as a 1-element tensor. | {"l": "{\"data\": [[-2.0, -1.6363636255264282, -1.2727272510528564, -0.9090908765792847], [-0.5454545021057129, -0.1818181276321411, 0.1818181276321411, 0.5454545021057129], [0.9090908765792847, 1.2727272510528564, 1.6363636255264282, 2.0]], \"dtype\": \"float32\", \"shape\": [3, 4]}"} | {"data": [1.5280470848083496], "dtype": "float32", "shape": [1]} |
torch-036 | losses | Return the PER-SAMPLE cross-entropy of logits `l` against targets [0, 3, 1] (reduction='none'). | {"l": "{\"data\": [[-2.0, -1.6363636255264282, -1.2727272510528564, -0.9090908765792847], [-0.5454545021057129, -0.1818181276321411, 0.1818181276321411, 0.5454545021057129], [0.9090908765792847, 1.2727272510528564, 1.6363636255264282, 2.0]], \"dtype\": \"float32\", \"shape\": [3, 4]}"} | {"data": [2.0128955841064453, 0.9219865202903748, 1.649259090423584], "dtype": "float32", "shape": [3]} |
torch-037 | losses | Return the binary cross-entropy between sigmoid(`x`) and a target of all 0.5, mean reduction, as a 1-element tensor. | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [1.0311164855957031], "dtype": "float32", "shape": [1]} |
torch-038 | losses | Return the L1 loss between `b` and b.roll(1, 0), mean reduction, as a 1-element tensor. | {"b": "{\"data\": [[0.0, 0.10000000149011612, 0.20000000298023224, 0.30000001192092896, 0.4000000059604645], [0.5, 0.6000000238418579, 0.699999988079071, 0.800000011920929, 0.9000000357627869], [1.0, 1.100000023841858, 1.2000000476837158, 1.3000000715255737, 1.399999976158142], [1.5, 1.600000023841858, 1.70000004768371... | {"data": [0.875], "dtype": "float32", "shape": [1]} |
torch-039 | losses | Return the smooth L1 loss (beta=1.0) between `x` and x.flip(0), mean reduction, as a 1-element tensor. | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [2.6551668643951416], "dtype": "float32", "shape": [1]} |
torch-040 | optim | Take `x` as a parameter, run ONE SGD step with lr=0.1 on the loss (x**2).sum(), and return the updated parameter values. | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [-2.4000000953674316, -2.1913044452667236, -1.9826087951660156, -1.773913025856018, -1.56521737575531, -1.3565218448638916, -1.147826075553894, -0.939130425453186, -0.730434775352478, -0.5217391848564148, -0.31304359436035156, -0.10434780269861221, 0.10434780269861221, 0.31304359436035156, 0.5217391848564148, ... |
torch-041 | optim | Take `x` as a parameter, run ONE SGD step with lr=0.1 and momentum=0.9 on the loss (x**2).sum(), and return the updated parameter values. | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [-2.4000000953674316, -2.1913044452667236, -1.9826087951660156, -1.773913025856018, -1.56521737575531, -1.3565218448638916, -1.147826075553894, -0.939130425453186, -0.730434775352478, -0.5217391848564148, -0.31304359436035156, -0.10434780269861221, 0.10434780269861221, 0.31304359436035156, 0.5217391848564148, ... |
torch-042 | optim | Take `x` as a parameter, run ONE Adam step with lr=0.1 (default betas/eps) on the loss (x**2).sum(), and return the updated parameter values. | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [-2.9000000953674316, -2.6391305923461914, -2.378261089324951, -2.117391347885132, -1.856521725654602, -1.5956522226333618, -1.334782600402832, -1.0739129781723022, -0.813043475151062, -0.5521739721298218, -0.29130449891090393, -0.030434750020503998, 0.030434750020503998, 0.29130449891090393, 0.552173972129821... |
torch-043 | optim | Take `x` as a parameter, run THREE SGD steps with lr=0.05 on the loss (x**2).sum(), and return the final parameter values. | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [-2.187000036239624, -1.9968260526657104, -1.806652307510376, -1.6164782047271729, -1.4263043403625488, -1.2361304759979248, -1.0459564924240112, -0.8557825684547424, -0.6656086444854736, -0.4754348397254944, -0.28526097536087036, -0.09508693218231201, 0.09508693218231201, 0.28526097536087036, 0.47543483972549... |
torch-044 | optim | Take `x` as a parameter and return the gradient after clipping the global grad-norm to 1.0, for the loss (x**2).sum(). | {"x": "{\"data\": [-3.0, -2.7391304969787598, -2.4782609939575195, -2.2173912525177, -1.95652174949646, -1.6956522464752197, -1.43478262424469, -1.1739130020141602, -0.9130434989929199, -0.6521739959716797, -0.39130449295043945, -0.13043475151062012, 0.13043475151062012, 0.39130449295043945, 0.6521739959716797, 0.91304... | {"data": [-0.3391164541244507, -0.30962806940078735, -0.280139684677124, -0.2506512701511383, -0.22116290032863617, -0.19167451560497284, -0.1621861308813095, -0.13269773125648499, -0.10320935398340225, -0.07372097671031952, -0.04423259571194649, -0.014744189567863941, 0.014744189567863941, 0.04423259571194649, 0.07372... |
pytorch-tasks-v1
Task dataset for a PyTorch RL / eval environment, in the shape used by the Prime Intellect Environments Hub.
45 PyTorch tasks across 5 categories. Each task gives the model one or more input tensors and
an instruction; the answer is the tensor left in result, graded with torch.allclose
against a reference. Grading is deterministic — no LLM judge, no external API, CPU only.
| Category | Tasks | Covers |
|---|---|---|
| tensor_ops | 16 | reshape, transpose, axis reductions, clamp, boolean masking, sort/argsort, cat/stack, matmul, L2 row-normalise, unsqueeze, cumsum, dtype cast, elementwise max |
| nn_modules | 12 | Linear and Conv2d with explicit weights, relu/gelu/sigmoid, softmax and log_softmax, LayerNorm, max/avg pooling, flatten, Embedding |
| autograd | 6 | backward on scalar losses, torch.autograd.grad, gradient through sin, clamp-ed exp, detach semantics, second derivatives with create_graph |
| losses | 6 | MSE, cross-entropy (mean and per-sample), binary cross-entropy, L1, smooth L1 |
| optim | 5 | one SGD step, SGD with momentum, one Adam step, three chained SGD steps, clip_grad_norm_ |
Fields
| Field | Description |
|---|---|
task_id |
stable id, e.g. torch-017 |
category |
one of the five above |
prompt |
the natural-language instruction shown to the model |
input_data |
JSON object mapping tensor name (x, m, b, i, s, l) to a serialised tensor |
expected_output |
the serialised reference result |
Tensors serialise as {"data": <nested list>, "dtype": <torch dtype without the prefix>, "shape": [...]}.
How it was built, and why you can trust the answer key
Tasks are defined as (deterministic input tensors, instruction, reference solution). The expected output is computed by executing the reference, never written by hand, so the key cannot drift from the instruction.
Every task is then independently verified:
- the reference runs and returns a real-valued tensor
- it is deterministic (executed twice, compared exactly)
- the result is finite — no NaN or inf in the answer key
- the result is non-empty and not identical to its input
- both the result and every input tensor survive the serialisation round-trip exactly, dtype and shape included
All 45 pass on torch 2.13.0+cpu. Builder and verifier:
build_tasks.py.
Why the nn layers use explicit weights
Linear, Conv2d and Embedding here are filled with arange/linspace/constant weights
rather than manual_seed plus default initialisation. Default initialisers and RNG stream
details are implementation choices that have changed between PyTorch releases; arange cannot.
A dataset whose labels silently change under pip install -U torch would be worse than no
dataset.
A note on grading tolerance
Grading uses torch.allclose (rtol 1e-5, atol 1e-7) rather than exact equality: matmul,
convolution and pooling dispatch to BLAS/oneDNN kernels whose last bits legitimately differ
across builds and architectures. Shape is compared exactly, and an integer-valued reference
requires an integer answer, so the tolerance never launders a wrong-shaped or wrong-typed
result.
- Downloads last month
- -