mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 00:21:07 +01:00
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
23 lines
577 B
C++
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));
|
|
}
|
|
|
|
}}
|