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

Enable graph building using C APIs? #23

Open
nikhilk opened this issue Jan 6, 2018 · 1 comment
Open

Enable graph building using C APIs? #23

nikhilk opened this issue Jan 6, 2018 · 1 comment

Comments

@nikhilk
Copy link
Owner

nikhilk commented Jan 6, 2018

The new C APIs support building ops and adding them to the Graph.
For example, from https://www.tensorflow.org/install/install_java

// Construct the computation graph with a single operation, a constant
// named "MyConst" with a value "value".
try (Tensor t = Tensor.create(value.getBytes("UTF-8"))) {
  // The Java API doesn't yet include convenience functions for adding operations.
  g.opBuilder("Const", "MyConst").setAttr("dtype", t.dataType()).setAttr("value", t).build();
}

We could provide equivalent in node.js (only better, in terms of API compared to Java). However, how useful is it ... vs. the idea of constructing graphs entirely in Python or with JSON (once #22 is fixed).

@nikhilk
Copy link
Owner Author

nikhilk commented Jan 16, 2018

ecd28d7 allows for JSON object for specifying graphs.
This might be more interesting that making repeated calls to TF APIs for each op.

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

No branches or pull requests

1 participant