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

Anyway to set the attr of operation after added to the gragh in C API? #60284

Open
AsakusaRinne opened this issue Apr 10, 2023 · 1 comment
Open
Assignees
Labels
comp:apis Highlevel API related issues stat:awaiting tensorflower Status - Awaiting response from tensorflower TF 2.11 Issues related to TF 2.11 type:support Support issues

Comments

@AsakusaRinne
Copy link
Contributor

AsakusaRinne commented Apr 10, 2023

Click to expand!

Issue Type

Support

Have you reproduced the bug with TF nightly?

No

Source

binary

Tensorflow Version

tf2.11

Custom Code

No

OS Platform and Distribution

Windows and Linux

Current Behaviour?

Hello, I'm a developer of Tensorflow.NET, which is a tensorflow binding for dotnet. When I implemented some feature, I could not find a C API to add attributes to an operation that has already been created and added to the graph. However, there is indeed such C API for python. It's located here.

Among exported C APIs of libtensorflow, only the following API was found:

TF_CAPI_EXPORT extern void TF_SetAttrValueProto(TF_OperationDescription* desc,
                                                const char* attr_name,
                                                const void* proto,
                                                size_t proto_len,
                                                TF_Status* status);

However, TF_OperationDescription is released after adding the operation to graph by calling TF_FinishOperation. Therefore I can't use the API to add attributes.

Is there any other way for us to add attributes for operations which have been added to graph?

Standalone code to reproduce the issue

The code is wrote in csharp. I'll give a minimal example if needed.

Relevant log output

No response

@AsakusaRinne
Copy link
Contributor Author

Also, is there any corresponding C API for GetHandleShapeAndType and SetHandleShapeAndType in python_api.h?

@sushreebarsa sushreebarsa added comp:apis Highlevel API related issues TF 2.11 Issues related to TF 2.11 labels Apr 10, 2023
@sachinprasadhs sachinprasadhs added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:apis Highlevel API related issues stat:awaiting tensorflower Status - Awaiting response from tensorflower TF 2.11 Issues related to TF 2.11 type:support Support issues
Projects
None yet
Development

No branches or pull requests

4 participants