pytorch/functorch/csrc/init_dim_only.cpp
Richard Zou 5e5c319549 Move functorch python bindings to torch/csrc (#85426)
This moves functorch's python bindings to torch/csrc/functorch/init.cpp.
Coming next is the torchdim move. I didn't do torchdim yet because
moving functorch's python bindings unblocks some other things that I
want to do first.

Test Plan:
- tests
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85426
Approved by: https://github.com/ezyang
2022-09-22 18:47:12 +00:00

23 lines
577 B
C++

// Copyright (c) Facebook, Inc. and its affiliates.
// All rights reserved.
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
#include <torch/extension.h>
#include <functorch/csrc/dim/dim.h>
namespace at {
namespace functorch {
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
// initialize first-class dims and install it as a submodule on _C
auto dim = Dim_init();
if (!dim) {
throw py::error_already_set();
}
py::setattr(m, "dim", py::reinterpret_steal<py::object>(dim));
}
}}