)]}'
{
  "commit": "194262ee49961acc8d84d6d4672748eae1826c30",
  "tree": "b6354099a28adf403ab86daa39691035fd8e62ca",
  "parents": [
    "47cfcf566ab76573452787335f10c9ca185752dc"
  ],
  "author": {
    "name": "Richard Zou",
    "email": "zou3519@gmail.com",
    "time": "Wed Jun 07 10:26:52 2023 -0700"
  },
  "committer": {
    "name": "PyTorch MergeBot",
    "email": "pytorchmergebot@users.noreply.github.com",
    "time": "Thu Jun 08 01:55:27 2023 +0000"
  },
  "message": "Make HigherOrderOperator stop appearing like torch.ops.* in FX (#103108)\n\nPreviously, defining a HigherOrderOperators (like cond) automatically generates\na torch.ops.cond and causes them to trace into the FX graph as e.g.\ntorch.ops.cond.\n\nThis is not good, because:\n- Duplication. Since HigherOrderOperators are written in Python, they have an\nassociated Python function that users should access them from. E.g.\ntorch.cond (when we make it public). That is what should actually appear in the\ngraph.\n- torch.ops.cond is a valid namespace for operator registration; having\nit be a function too confuses things.\n\nThis PR:\n- Moves cond/map HigherOrderOperators to be under torch (necessary for\nthe FX logic to not do weird things)\n- Sets the `__module__` of a HigherOrderOperator correct. This is what\nFX uses when tracing the operator.\n\nTest Plan:\n- updated tests\n\nFuture:\n- I\u0027ll delete the ability to call cond as torch.ops.cond in a couple of\ndays, after this change circulates internally.\nPull Request resolved: https://github.com/pytorch/pytorch/pull/103108\nApproved by: https://github.com/ydwu4\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "961a2d4e9b8bf372313e742fd4dda8166819cffd",
      "old_mode": 33188,
      "old_path": ".lintrunner.toml",
      "new_id": "befabd52b88c7cfb33fc7f0b181223e8075b90b0",
      "new_mode": 33188,
      "new_path": ".lintrunner.toml"
    },
    {
      "type": "modify",
      "old_id": "d13aa9c1038ebd7108b50b8f401aa409e54c36d3",
      "old_mode": 33188,
      "old_path": "functorch/experimental/_map.py",
      "new_id": "cefafa3012835b34838edc8e4b8a8c53188e6831",
      "new_mode": 33188,
      "new_path": "functorch/experimental/_map.py"
    },
    {
      "type": "modify",
      "old_id": "5d42598c757aa0c1b894999b10b0737298c8442a",
      "old_mode": 33188,
      "old_path": "functorch/experimental/control_flow.py",
      "new_id": "511482c57205b6e041a9377a031ff94bfa846d40",
      "new_mode": 33188,
      "new_path": "functorch/experimental/control_flow.py"
    },
    {
      "type": "modify",
      "old_id": "70d1ff02d39667b0b995a7182736de1ba4df1a99",
      "old_mode": 33188,
      "old_path": "test/functorch/test_control_flow.py",
      "new_id": "ac2d2d50ff897c61c5cff34af046d359f061a8a5",
      "new_mode": 33188,
      "new_path": "test/functorch/test_control_flow.py"
    },
    {
      "type": "rename",
      "old_id": "f17eca587550ecb18fb4bbbcf79363080f85cd78",
      "old_mode": 33188,
      "old_path": "functorch/experimental/_cond.py",
      "new_id": "f17eca587550ecb18fb4bbbcf79363080f85cd78",
      "new_mode": 33188,
      "new_path": "torch/_higher_order_ops/_cond.py",
      "score": 100
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "d13aa9c1038ebd7108b50b8f401aa409e54c36d3",
      "new_mode": 33188,
      "new_path": "torch/_higher_order_ops/_map.py"
    },
    {
      "type": "modify",
      "old_id": "16dbe75d1746177f5bdfed1c4d438c294d201e7f",
      "old_mode": 33188,
      "old_path": "torch/_ops.py",
      "new_id": "5dc7a5fb4815b4c44b19f3a1a3bf0773f82b79b3",
      "new_mode": 33188,
      "new_path": "torch/_ops.py"
    }
  ]
}
