{"task": {"agent_timeout": 1800, "task": "962", "verifier_timeout": 1800, "instruction": "# 962: DS-1000 Task\n\n## Prompt\nProblem:\n\nGiven a 3d tenzor, say: batch x sentence length x embedding dim\n\na = torch.rand((10, 1000, 23))\nand an array(or tensor) of actual lengths for each sentence\n\nlengths =  torch .randint(1000,(10,))\noutputs tensor([ 137., 152., 165., 159., 145., 264., 265., 276.,1000., 203.])\n\nHow to fill tensor \u2018a\u2019 with 0 before certain index along dimension 1 (sentence length) according to tensor \u2018lengths\u2019 ?\n\nI want smth like that :\n\na[ : , : lengths , : ]  = 0\n\n\nA:\n\n<code>\nimport numpy as np\nimport pandas as pd\nimport torch\na = torch.rand((10, 1000, 23))\nlengths = torch.randint(1000, (10,))\n</code>\na = ... # put solution in this variable\nBEGIN SOLUTION\n<code>\n\n## What to do\n- Edit `solution/solution.py` so the code passes the DS-1000 tests.\n- Do not access the internet or install new packages; required libraries are preinstalled in the Docker image.\n- Run tests locally via `bash tests/test.sh`.\n\n## Notes\n- Keep the variable names/signatures implied by the prompt/code_context.\n- The evaluator uses the original DS-1000 `code_context` (`test_execution` / `test_string`).\n", "memory": "", "runnable": false, "difficulty": "", "language": "", "cpus": "", "instruction_truncated": false, "category": "", "compose": false, "has_solution": true, "oracle": null, "docker_image": "ds1000:latest", "taskset": "ds1000", "tags": []}, "runs": []}