Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change for sd torch graph compile #10317

Merged
merged 6 commits into from
Aug 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions oneflow/api/python/framework/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ ONEFLOW_API_PYBIND11_MODULE("", m) {
.def(py::init([](const std::string& type_or_type_with_device_id) {
return Device::ParseAndNew(type_or_type_with_device_id).GetOrThrow();
}))
.def(py::init([](const std::string& type, int64_t device_id) {
return Device::New(type, device_id).GetOrThrow();
}))
.def(py::init([](const std::string& type, int64_t index) {
return Device::New(type, index).GetOrThrow();
}),
py::arg("type"), py::arg("index"))
.def(py::init([](const Symbol<Device>& other_device) { return other_device; }))
.def_property_readonly("type", [](const Symbol<Device>& d) { return d->type(); })
.def_property_readonly("index", [](const Symbol<Device>& d) { return d->device_id(); })
Expand Down
Loading