Skip to content

Conversation

@copybara-service
Copy link

Expose profiler advanced configuration as a Python dict.

In profiler.cc, the advanced_configuration property of tensorflow::ProfileOptions is now exposed as a Python dictionary. The getter converts the proto map to a nb::dict, handling different value types (bool, int64, string).

Example error:

ProfileOptions().advanced_configuration
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Unable to convert function return value to a Python type! The signature was
    (self) -> proto2::Map<std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char>>, tensorflow::ProfileOptions_AdvancedConfigValue>

In profiler.cc, the advanced_configuration property of tensorflow::ProfileOptions is now exposed as a Python dictionary. The getter converts the proto map to a nb::dict, handling different value types (bool, int64, string).

Example error:
```
ProfileOptions().advanced_configuration
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Unable to convert function return value to a Python type! The signature was
    (self) -> proto2::Map<std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char>>, tensorflow::ProfileOptions_AdvancedConfigValue>
```
PiperOrigin-RevId: 841944949
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant