Skip to content

Commit

Permalink
[XLA][NFC] Make interface of module loaders consistent.
Browse files Browse the repository at this point in the history
LoadModuleFromData has (data, format, config, ...) signature while FromFile has (path, config, format, ...). Change the latter so `format` becomes the second argument in both cases.

Since I'm touching this file:
* Use `std::string_view` and `absl::Status`
* Change `ovr_config` parameter to `const &`

PiperOrigin-RevId: 601304308
  • Loading branch information
olegshyshkov authored and jax authors committed Jan 25, 2024
1 parent 5fb8b29 commit fb80d2a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/jax_cpp/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ int main(int argc, char** argv) {
std::function<void(xla::HloModuleConfig*)> config_modifier_hook =
[](xla::HloModuleConfig* config) { config->set_seed(42); };
std::unique_ptr<xla::HloModule> test_module =
LoadModuleFromFile(hlo_filename, xla::hlo_module_loader_details::Config(),
"txt", config_modifier_hook)
LoadModuleFromFile(hlo_filename, /*format=*/"txt",
xla::hlo_module_loader_details::Config(),
config_modifier_hook)
.value();
const xla::HloModuleProto test_module_proto = test_module->ToProto();

Expand Down

0 comments on commit fb80d2a

Please sign in to comment.