Skip to content

Commit

Permalink
* Include tensorflow/core/graph/dot.h header file from TensorFlow …
Browse files Browse the repository at this point in the history
…(pull #272)
  • Loading branch information
saudet committed Aug 31, 2016
1 parent 2ecc400 commit 723d75d
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

* Include `tensorflow/core/graph/dot.h` header file from TensorFlow ([pull #272](https://github.com/bytedeco/javacpp-presets/pull/272))
* Add presets for OpenBLAS/MKL ([issue #112](https://github.com/bytedeco/javacpp-presets/issues/112))
* Make Caffe work on CPU-only machines ([issue #219](https://github.com/bytedeco/javacpp-presets/issues/219))
* Fix loading issue with `opencv_face` ([issue bytedeco/javacv#470](https://github.com/bytedeco/javacv/issues/470)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.bytedeco.javacpp.BytePointer;
import org.bytedeco.javacpp.FunctionPointer;
import org.bytedeco.javacpp.Loader;
Expand All @@ -52,9 +51,7 @@
"tensorflow/core/lib/core/stringpiece.h", */ "tensorflow/core/platform/types.h", "tensorflow/core/platform/mutex.h",
"tensorflow/core/platform/macros.h", "tensorflow/core/util/port.h", "tensorflow/core/lib/core/error_codes.pb.h",
"tensorflow/core/platform/logging.h", "tensorflow/core/lib/core/status.h", "tensorflow/core/platform/protobuf.h",
"tensorflow/core/platform/file_system.h", "tensorflow/core/platform/env.h",
"tensorflow/core/graph/dot.h",
"tensorflow/core/graph/graph.h",
"tensorflow/core/platform/file_system.h", "tensorflow/core/platform/env.h", "tensorflow/core/graph/dot.h",
"tensorflow/core/protobuf/config.pb.h", "tensorflow/core/framework/cost_graph.pb.h",
"tensorflow/core/framework/step_stats.pb.h", "tensorflow/core/framework/versions.pb.h", "tensorflow/core/public/session_options.h",
"tensorflow/core/lib/core/threadpool.h", "tensorflow/core/framework/allocation_description.pb.h", "tensorflow/core/framework/allocator.h",
Expand Down Expand Up @@ -259,8 +256,6 @@ public static class EdgeLabelFunction extends FunctionPointer {
public native @StdString BytePointer call(@Cast("const tensorflow::Edge*") Pointer node);
}



@Documented @Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.PARAMETER})
@Cast({"tensorflow::gtl::ArraySlice", "&"}) @Adapter("ArraySliceAdapter")
Expand Down
82 changes: 82 additions & 0 deletions tensorflow/src/main/java/org/bytedeco/javacpp/tensorflow.java
Original file line number Diff line number Diff line change
Expand Up @@ -1592,6 +1592,88 @@ public native Thread StartThread(@Const @ByRef ThreadOptions thread_options, @St
// #endif // TENSORFLOW_CORE_PLATFORM_ENV_H_


// Parsed from tensorflow/core/graph/dot.h

/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

// #ifndef TENSORFLOW_GRAPH_DOT_H_
// #define TENSORFLOW_GRAPH_DOT_H_

// #include <functional>
// #include <string>
// #include "tensorflow/core/platform/types.h"

@Namespace("tensorflow") public static class DotOptions extends Pointer {
static { Loader.load(); }
/** Default native constructor. */
public DotOptions() { super((Pointer)null); allocate(); }
/** Native array allocator. Access with {@link Pointer#position(long)}. */
public DotOptions(long size) { super((Pointer)null); allocateArray(size); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public DotOptions(Pointer p) { super(p); }
private native void allocate();
private native void allocateArray(long size);
@Override public DotOptions position(long position) {
return (DotOptions)super.position(position);
}

public static class Include_node_function_Node extends FunctionPointer {
static { Loader.load(); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public Include_node_function_Node(Pointer p) { super(p); }
protected Include_node_function_Node() { allocate(); }
private native void allocate();
public native @Cast("bool") boolean call(@Const Node arg0);
}
public native Include_node_function_Node include_node_function(); public native DotOptions include_node_function(Include_node_function_Node include_node_function);

// By default, all nodes with the same name prefix are collapsed into
// a single node in the dot graph. This regexp can be changed so that
// only prefixes that match the regexp are collapsed in this fashion.
// 'all' collapses all ops with prefixes, 'none' disables all collapsing.
public native @StdString BytePointer prefix_collapse_regexp(); public native DotOptions prefix_collapse_regexp(BytePointer prefix_collapse_regexp);

// A function that returns a label to embed into the per-node display.
@MemberSetter public native DotOptions node_label(NodeLabelFunction node_label_function);

// A function that returns a label to attach to an edge.
@MemberSetter public native DotOptions edge_label(EdgeLabelFunction edge_label_function);

// A function that returns the "cost" of the node. The dot display
// makes a node size proportional to its cost.
@MemberSetter public native DotOptions node_cost(NodeCostFunction node_cost_function);

// A function that returns the "cost" of the edge. The dot display
// makes a edge thickness proportional to its cost.
@MemberSetter public native DotOptions edge_cost(EdgeCostFunction edge_cost_function);

// A function that returns a color number to apply to each node. < 0 means
// no color. A color will be assigned to each color number from a palette;
// adjacent color numbers will receive different colors.
@MemberSetter public native DotOptions node_color(NodeColorFunction node_color_function);
}

// Return a string that contains a graphviz specification of the graph.
@Namespace("tensorflow") public static native @StdString BytePointer DotGraph(@Const @ByRef Graph g, @Const @ByRef DotOptions opts);

// namespace tensorflow

// #endif // TENSORFLOW_GRAPH_DOT_H_


// Parsed from tensorflow/core/protobuf/config.pb.h

// Generated by the protocol buffer compiler. DO NOT EDIT!
Expand Down

0 comments on commit 723d75d

Please sign in to comment.