MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / Deserialize

Method Deserialize

oneflow/core/hardware/net_socket_device_descriptor.cpp:86–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86std::shared_ptr<const NetSocketDeviceDescriptor> NetSocketDeviceDescriptor::Deserialize(
87 const std::string& serialized) {
88 auto json_object = nlohmann::json::parse(serialized);
89 auto* desc = new NetSocketDeviceDescriptor();
90 desc->impl_->ordinal = json_object[kJsonKeyOrdinal];
91 desc->impl_->name = json_object[kJsonKeyName];
92 desc->impl_->address = json_object[kJsonKeyAddress];
93 desc->impl_->pci_bus_id = json_object[kJsonKeyPCIBusID];
94 return std::shared_ptr<const NetSocketDeviceDescriptor>(desc);
95}
96
97} // namespace hardware
98

Callers

nothing calls this directly

Calls 1

parseFunction · 0.85

Tested by

no test coverage detected