Skip to content

C API Locking prevents custom gradient definition #48767

Description

@rnett

I am trying to add custom gradient support to the Java bindings (tensorflow/java#292). This is currently being prevented by the fact that TF_AddGradientsWithPrefix requires a lock on the graph, but so do any operation creation methods (i.e. TF_NewOperation), so it is impossible to create ops in gradient functions.

Is there a way I can get around this? I am considering calling TF_NewOperationLocked directly but I assume the locks are there for a reason.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions