All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bytedeco.javacpp.tensorflow Maven / Gradle / Ivy

There is a newer version: 1.12.0-1.4.4
Show newest version
// Targeted by JavaCPP version 1.2: DO NOT EDIT THIS FILE

package org.bytedeco.javacpp;

import java.nio.*;
import org.bytedeco.javacpp.*;
import org.bytedeco.javacpp.annotation.*;

public class tensorflow extends org.bytedeco.javacpp.helper.tensorflow {
    static { Loader.load(); }

@Name("tensorflow::gtl::InlinedVector") public static class LongVector extends Pointer {
    static { Loader.load(); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public LongVector(Pointer p) { super(p); }
    public LongVector()       { allocate();  }
    private native void allocate();
    public native @Name("operator=") @ByRef LongVector put(@ByRef LongVector x);

    public native long size();

    @Index public native @Cast("tensorflow::int64") long get(@Cast("size_t") long i);
    public native LongVector put(@Cast("size_t") long i, long value);
}

@Name("tensorflow::gtl::InlinedVector") public static class DataTypeVector extends Pointer {
    static { Loader.load(); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public DataTypeVector(Pointer p) { super(p); }
    public DataTypeVector()       { allocate();  }
    private native void allocate();
    public native @Name("operator=") @ByRef DataTypeVector put(@ByRef DataTypeVector x);

    public native long size();

    @Index public native @Cast("tensorflow::DataType") int get(@Cast("size_t") long i);
    public native DataTypeVector put(@Cast("size_t") long i, int value);
}

@Name("google::protobuf::Map") public static class StringAttrValueMap extends Pointer {
    static { Loader.load(); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public StringAttrValueMap(Pointer p) { super(p); }
    public StringAttrValueMap()       { allocate();  }
    private native void allocate();
    public native @Name("operator=") @ByRef StringAttrValueMap put(@ByRef StringAttrValueMap x);

    public native long size();

    @Index public native @ByRef AttrValue get(@StdString BytePointer i);
    public native StringAttrValueMap put(@StdString BytePointer i, AttrValue value);

    public native @ByVal Iterator begin();
    public native @ByVal Iterator end();
    @NoOffset @Name("iterator") public static class Iterator extends Pointer {
        public Iterator(Pointer p) { super(p); }
        public Iterator() { }

        public native @Name("operator++") @ByRef Iterator increment();
        public native @Name("operator==") boolean equals(@ByRef Iterator it);
        public native @Name("operator*().first") @MemberGetter @StdString BytePointer first();
        public native @Name("operator*().second") @MemberGetter @ByRef AttrValue second();
    }
}

@Name("std::vector") public static class StringVector extends Pointer {
    static { Loader.load(); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public StringVector(Pointer p) { super(p); }
    public StringVector(BytePointer ... array) { this(array.length); put(array); }
    public StringVector(String ... array) { this(array.length); put(array); }
    public StringVector()       { allocate();  }
    public StringVector(long n) { allocate(n); }
    private native void allocate();
    private native void allocate(@Cast("size_t") long n);
    public native @Name("operator=") @ByRef StringVector put(@ByRef StringVector x);

    public native long size();
    public native void resize(@Cast("size_t") long n);

    @Index public native @StdString BytePointer get(@Cast("size_t") long i);
    public native StringVector put(@Cast("size_t") long i, BytePointer value);
    @ValueSetter @Index public native StringVector put(@Cast("size_t") long i, @StdString String value);

    public StringVector put(BytePointer ... array) {
        if (size() != array.length) { resize(array.length); }
        for (int i = 0; i < array.length; i++) {
            put(i, array[i]);
        }
        return this;
    }

    public StringVector put(String ... array) {
        if (size() != array.length) { resize(array.length); }
        for (int i = 0; i < array.length; i++) {
            put(i, array[i]);
        }
        return this;
    }
}

@Name("std::vector") public static class TensorVector extends Pointer {
    static { Loader.load(); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public TensorVector(Pointer p) { super(p); }
    public TensorVector(Tensor ... array) { this(array.length); put(array); }
    public TensorVector()       { allocate();  }
    public TensorVector(long n) { allocate(n); }
    private native void allocate();
    private native void allocate(@Cast("size_t") long n);
    public native @Name("operator=") @ByRef TensorVector put(@ByRef TensorVector x);

    public native long size();
    public native void resize(@Cast("size_t") long n);

    @Index public native @ByRef Tensor get(@Cast("size_t") long i);
    public native TensorVector put(@Cast("size_t") long i, Tensor value);

    public TensorVector put(Tensor ... array) {
        if (size() != array.length) { resize(array.length); }
        for (int i = 0; i < array.length; i++) {
            put(i, array[i]);
        }
        return this;
    }
}

@Name("std::vector") public static class TensorProtoVector extends Pointer {
    static { Loader.load(); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public TensorProtoVector(Pointer p) { super(p); }
    public TensorProtoVector(TensorProto ... array) { this(array.length); put(array); }
    public TensorProtoVector()       { allocate();  }
    public TensorProtoVector(long n) { allocate(n); }
    private native void allocate();
    private native void allocate(@Cast("size_t") long n);
    public native @Name("operator=") @ByRef TensorProtoVector put(@ByRef TensorProtoVector x);

    public native long size();
    public native void resize(@Cast("size_t") long n);

    @Index public native @ByRef TensorProto get(@Cast("size_t") long i);
    public native TensorProtoVector put(@Cast("size_t") long i, TensorProto value);

    public TensorProtoVector put(TensorProto ... array) {
        if (size() != array.length) { resize(array.length); }
        for (int i = 0; i < array.length; i++) {
            put(i, array[i]);
        }
        return this;
    }
}

@Name("std::vector") public static class TensorShapeVector extends Pointer {
    static { Loader.load(); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public TensorShapeVector(Pointer p) { super(p); }
    public TensorShapeVector(TensorShape ... array) { this(array.length); put(array); }
    public TensorShapeVector()       { allocate();  }
    public TensorShapeVector(long n) { allocate(n); }
    private native void allocate();
    private native void allocate(@Cast("size_t") long n);
    public native @Name("operator=") @ByRef TensorShapeVector put(@ByRef TensorShapeVector x);

    public native long size();
    public native void resize(@Cast("size_t") long n);

    @Index public native @ByRef TensorShape get(@Cast("size_t") long i);
    public native TensorShapeVector put(@Cast("size_t") long i, TensorShape value);

    public TensorShapeVector put(TensorShape ... array) {
        if (size() != array.length) { resize(array.length); }
        for (int i = 0; i < array.length; i++) {
            put(i, array[i]);
        }
        return this;
    }
}

@Name("std::vector") public static class NodeOutVector extends Pointer {
    static { Loader.load(); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public NodeOutVector(Pointer p) { super(p); }
    public NodeOutVector(NodeBuilder.NodeOut ... array) { this(array.length); put(array); }
    public NodeOutVector()       { allocate();  }
    public NodeOutVector(long n) { allocate(n); }
    private native void allocate();
    private native void allocate(@Cast("size_t") long n);
    public native @Name("operator=") @ByRef NodeOutVector put(@ByRef NodeOutVector x);

    public native long size();
    public native void resize(@Cast("size_t") long n);

    @Index public native @ByRef NodeBuilder.NodeOut get(@Cast("size_t") long i);
    public native NodeOutVector put(@Cast("size_t") long i, NodeBuilder.NodeOut value);

    public NodeOutVector put(NodeBuilder.NodeOut ... array) {
        if (size() != array.length) { resize(array.length); }
        for (int i = 0; i < array.length; i++) {
            put(i, array[i]);
        }
        return this;
    }
}

@Name("std::vector") public static class NodeVector extends Pointer {
    static { Loader.load(); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public NodeVector(Pointer p) { super(p); }
    public NodeVector(Node ... array) { this(array.length); put(array); }
    public NodeVector()       { allocate();  }
    public NodeVector(long n) { allocate(n); }
    private native void allocate();
    private native void allocate(@Cast("size_t") long n);
    public native @Name("operator=") @ByRef NodeVector put(@ByRef NodeVector x);

    public native long size();
    public native void resize(@Cast("size_t") long n);

    @Index public native Node get(@Cast("size_t") long i);
    public native NodeVector put(@Cast("size_t") long i, Node value);

    public NodeVector put(Node ... array) {
        if (size() != array.length) { resize(array.length); }
        for (int i = 0; i < array.length; i++) {
            put(i, array[i]);
        }
        return this;
    }
}

@Name("std::vector >") public static class StringTensorPairVector extends Pointer {
    static { Loader.load(); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public StringTensorPairVector(Pointer p) { super(p); }
    public StringTensorPairVector(BytePointer[] firstValue, Tensor[] secondValue) { this(Math.min(firstValue.length, secondValue.length)); put(firstValue, secondValue); }
    public StringTensorPairVector(String[] firstValue, Tensor[] secondValue) { this(Math.min(firstValue.length, secondValue.length)); put(firstValue, secondValue); }
    public StringTensorPairVector()       { allocate();  }
    public StringTensorPairVector(long n) { allocate(n); }
    private native void allocate();
    private native void allocate(@Cast("size_t") long n);
    public native @Name("operator=") @ByRef StringTensorPairVector put(@ByRef StringTensorPairVector x);

    public native long size();
    public native void resize(@Cast("size_t") long n);

    @Index public native @StdString BytePointer first(@Cast("size_t") long i); public native StringTensorPairVector first(@Cast("size_t") long i, BytePointer first);
    @Index public native @ByRef Tensor second(@Cast("size_t") long i);  public native StringTensorPairVector second(@Cast("size_t") long i, Tensor second);
    @MemberSetter @Index public native StringTensorPairVector first(@Cast("size_t") long i, @StdString String first);

    public StringTensorPairVector put(BytePointer[] firstValue, Tensor[] secondValue) {
        for (int i = 0; i < firstValue.length && i < secondValue.length; i++) {
            first(i, firstValue[i]);
            second(i, secondValue[i]);
        }
        return this;
    }

    public StringTensorPairVector put(String[] firstValue, Tensor[] secondValue) {
        for (int i = 0; i < firstValue.length && i < secondValue.length; i++) {
            first(i, firstValue[i]);
            second(i, secondValue[i]);
        }
        return this;
    }
}

@NoOffset @Name("std::pair") public static class EdgeSetBoolPair extends Pointer {
    static { Loader.load(); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public EdgeSetBoolPair(Pointer p) { super(p); }
    public EdgeSetBoolPair(EdgeSetIterator firstValue, boolean secondValue) { this(); put(firstValue, secondValue); }
    public EdgeSetBoolPair()       { allocate();  }
    private native void allocate();
    public native @Name("operator=") @ByRef EdgeSetBoolPair put(@ByRef EdgeSetBoolPair x);


    @MemberGetter public native @ByRef EdgeSetIterator first(); public native EdgeSetBoolPair first(EdgeSetIterator first);
    @MemberGetter public native @Cast("bool") boolean second();  public native EdgeSetBoolPair second(boolean second);

    public EdgeSetBoolPair put(EdgeSetIterator firstValue, boolean secondValue) {
        first(firstValue);
        second(secondValue);
        return this;
    }
}

// Parsed from tensorflow/core/platform/default/integral_types.h

/* Copyright 2015 Google Inc. 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_PLATFORM_DEFAULT_INTEGRAL_TYPES_H_
// #define TENSORFLOW_PLATFORM_DEFAULT_INTEGRAL_TYPES_H_

// IWYU pragma: private, include "third_party/tensorflow/core/platform/types.h"
// IWYU pragma: friend third_party/tensorflow/core/platform/types.h

  // namespace tensorflow

// #endif  // TENSORFLOW_PLATFORM_DEFAULT_INTEGRAL_TYPES_H_


// Parsed from tensorflow/core/framework/numeric_types.h

/* Copyright 2015 Google Inc. 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_FRAMEWORK_NUMERIC_TYPES_H_
// #define TENSORFLOW_FRAMEWORK_NUMERIC_TYPES_H_

// #include 

// #include "tensorflow/core/platform/types.h"

// Single precision complex.
// Double precision complex.

  // end namespace tensorflow

// #endif  // TENSORFLOW_FRAMEWORK_NUMERIC_TYPES_H_


// Parsed from tensorflow/core/platform/init_main.h

/* Copyright 2015 Google Inc. 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_PLATFORM_INIT_MAIN_H_
// #define TENSORFLOW_PLATFORM_INIT_MAIN_H_

// Platform-specific initialization routine that may be invoked by a
// main() program that uses TensorFlow.
//
// Default implementation does nothing.
@Namespace("tensorflow::port") public static native void InitMain(@Cast("const char*") BytePointer usage, IntPointer argc, @Cast("char***") PointerPointer argv);
@Namespace("tensorflow::port") public static native void InitMain(String usage, IntBuffer argc, @Cast("char***") PointerPointer argv);
@Namespace("tensorflow::port") public static native void InitMain(@Cast("const char*") BytePointer usage, int[] argc, @Cast("char***") PointerPointer argv);
@Namespace("tensorflow::port") public static native void InitMain(String usage, IntPointer argc, @Cast("char***") PointerPointer argv);
@Namespace("tensorflow::port") public static native void InitMain(@Cast("const char*") BytePointer usage, IntBuffer argc, @Cast("char***") PointerPointer argv);
@Namespace("tensorflow::port") public static native void InitMain(String usage, int[] argc, @Cast("char***") PointerPointer argv);

  // namespace port
  // namespace tensorflow

// #endif  // TENSORFLOW_PLATFORM_INIT_MAIN_H_


// Parsed from tensorflow/core/platform/types.h

/* Copyright 2015 Google Inc. 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_PLATFORM_TYPES_H_
// #define TENSORFLOW_PLATFORM_TYPES_H_

// #include 
// #include "tensorflow/core/platform/platform.h"

// Include appropriate platform-dependent implementations
// #if defined(PLATFORM_GOOGLE)
// #include "tensorflow/core/platform/google/integral_types.h"
// #elif defined(PLATFORM_POSIX) || defined(PLATFORM_POSIX_ANDROID) ||
//     defined(PLATFORM_GOOGLE_ANDROID)
// #include "tensorflow/core/platform/default/integral_types.h"
// #else
// #error Define the appropriate PLATFORM_ macro for this platform
// #endif

// Define tensorflow::string to refer to appropriate platform specific type.
// TODO(josh11b): Move this into the platform/*/integral_types.h files
// above, and rename them platform/*/types.h.
// #if defined(PLATFORM_GOOGLE)
// #else
// #endif

@Namespace("tensorflow") @MemberGetter public static native @Cast("const tensorflow::uint8") byte kuint8max();
public static final byte kuint8max = kuint8max();
@Namespace("tensorflow") @MemberGetter public static native short kuint16max();
public static final short kuint16max = kuint16max();
@Namespace("tensorflow") @MemberGetter public static native int kuint32max();
public static final int kuint32max = kuint32max();
@Namespace("tensorflow") @MemberGetter public static native @Cast("const tensorflow::uint64") long kuint64max();
public static final long kuint64max = kuint64max();
@Namespace("tensorflow") @MemberGetter public static native @Cast("const tensorflow::int8") byte kint8min();
public static final byte kint8min = kint8min();
@Namespace("tensorflow") @MemberGetter public static native @Cast("const tensorflow::int8") byte kint8max();
public static final byte kint8max = kint8max();
@Namespace("tensorflow") @MemberGetter public static native short kint16min();
public static final short kint16min = kint16min();
@Namespace("tensorflow") @MemberGetter public static native short kint16max();
public static final short kint16max = kint16max();
@Namespace("tensorflow") @MemberGetter public static native int kint32min();
public static final int kint32min = kint32min();
@Namespace("tensorflow") @MemberGetter public static native int kint32max();
public static final int kint32max = kint32max();
@Namespace("tensorflow") @MemberGetter public static native @Cast("const tensorflow::int64") long kint64min();
public static final long kint64min = kint64min();
@Namespace("tensorflow") @MemberGetter public static native @Cast("const tensorflow::int64") long kint64max();
public static final long kint64max = kint64max();

// A typedef for a uint64 used as a short fingerprint.

  // namespace tensorflow

// #endif  // TENSORFLOW_PLATFORM_TYPES_H_


// Parsed from tensorflow/core/platform/mutex.h

/* Copyright 2015 Google Inc. 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_PLATFORM_MUTEX_H_
// #define TENSORFLOW_PLATFORM_MUTEX_H_

// #include "tensorflow/core/platform/platform.h"
// #include "tensorflow/core/platform/types.h"
/** enum tensorflow::ConditionResult */
public static final int kCond_Timeout = 0, kCond_MaybeNotified = 1;
  // namespace tensorflow

// Include appropriate platform-dependent implementations of mutex etc.
// #if defined(PLATFORM_GOOGLE)
// #include "tensorflow/core/platform/google/mutex.h"
// #elif defined(PLATFORM_POSIX) || defined(PLATFORM_POSIX_ANDROID) ||
//     defined(PLATFORM_GOOGLE_ANDROID)
// #include "tensorflow/core/platform/default/mutex.h"
// #else
// #error Define the appropriate PLATFORM_ macro for this platform
// #endif

// The mutex library included above defines:
//   class mutex;
//   class mutex_lock;
//   class condition_variable;
// It also defines the following:

// Like "cv->wait(*mu)", except that it only waits for up to "ms" milliseconds.
//
// Returns kCond_Timeout if the timeout expired without this
// thread noticing a signal on the condition variable.  Otherwise may
// return either kCond_Timeout or kCond_MaybeNotified
@Namespace("tensorflow") public static native @Cast("tensorflow::ConditionResult") int WaitForMilliseconds(@Cast("tensorflow::mutex_lock*") Pointer mu, @Cast("tensorflow::condition_variable*") Pointer cv,
                                    @Cast("tensorflow::int64") long ms);
  // namespace tensorflow

// #endif  // TENSORFLOW_PLATFORM_MUTEX_H_


// Parsed from tensorflow/core/platform/macros.h

/* Copyright 2015 Google Inc. 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_PLATFORM_MACROS_H_
// #define TENSORFLOW_PLATFORM_MACROS_H_

// Compiler attributes
// #if (defined(__GNUC__) || defined(__APPLE__)) && !defined(SWIG)
// Compiler supports GCC-style attributes
// #define TF_ATTRIBUTE_NORETURN __attribute__((noreturn))
// #define TF_ATTRIBUTE_NOINLINE __attribute__((noinline))
// #define TF_ATTRIBUTE_UNUSED __attribute__((unused))
// #define TF_ATTRIBUTE_COLD __attribute__((cold))
// #define TF_PACKED __attribute__((packed))
// #define TF_MUST_USE_RESULT __attribute__((warn_unused_result))
// #define TF_PRINTF_ATTRIBUTE(string_index, first_to_check)
//   __attribute__((__format__(__printf__, string_index, first_to_check)))
// #define TF_SCANF_ATTRIBUTE(string_index, first_to_check)
//   __attribute__((__format__(__scanf__, string_index, first_to_check)))

// #else
// Non-GCC equivalents
// #define TF_ATTRIBUTE_NORETURN
// #define TF_ATTRIBUTE_NOINLINE
// #define TF_ATTRIBUTE_UNUSED
// #define TF_ATTRIBUTE_COLD
// #define TF_MUST_USE_RESULT
// #define TF_PACKED
// #define TF_PRINTF_ATTRIBUTE(string_index, first_to_check)
// #define TF_SCANF_ATTRIBUTE(string_index, first_to_check)
// #endif

// GCC can be told that a certain branch is not likely to be taken (for
// instance, a CHECK failure), and use that information in static analysis.
// Giving it this information can help it optimize for the common case in
// the absence of better information (ie. -fprofile-arcs).
// #if defined(COMPILER_GCC3)
// #define TF_PREDICT_FALSE(x) (__builtin_expect(x, 0))
// #define TF_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
// #else
// #define TF_PREDICT_FALSE(x) (x)
// #define TF_PREDICT_TRUE(x) (x)
// #endif

// A macro to disallow the copy constructor and operator= functions
// This is usually placed in the private: declarations for a class.
// #define TF_DISALLOW_COPY_AND_ASSIGN(TypeName)
//   TypeName(const TypeName&) = delete;
//   void operator=(const TypeName&) = delete

// The TF_ARRAYSIZE(arr) macro returns the # of elements in an array arr.
//
// The expression TF_ARRAYSIZE(a) is a compile-time constant of type
// size_t.
// #define TF_ARRAYSIZE(a)
//   ((sizeof(a) / sizeof(*(a))) /
//    static_cast(!(sizeof(a) % sizeof(*(a)))))

// #if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
// Define this to 1 if the code is compiled in C++11 mode; leave it
// undefined otherwise.  Do NOT define it to 0 -- that causes
// '#ifdef LANG_CXX11' to behave differently from '#if LANG_CXX11'.
public static final int LANG_CXX11 = 1;
// #endif

// #if defined(__clang__) && defined(LANG_CXX11) && defined(__has_warning)
// #if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
// #define TF_FALLTHROUGH_INTENDED [[clang::fallthrough]]  // NOLINT
// #endif
// #endif

// #ifndef TF_FALLTHROUGH_INTENDED
// #define TF_FALLTHROUGH_INTENDED
//   do {
//   } while (0)
// #endif

// #endif  // TENSORFLOW_PLATFORM_MACROS_H_


// Parsed from tensorflow/core/util/port.h

/* Copyright 2015 Google Inc. 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_UTIL_PORT_H_
// #define TENSORFLOW_UTIL_PORT_H_

// Returns true if GOOGLE_CUDA is defined.
@Namespace("tensorflow") public static native @Cast("bool") boolean IsGoogleCudaEnabled();

  // end namespace tensorflow

// #endif  // TENSORFLOW_UTIL_PORT_H_


// Parsed from tensorflow/core/lib/core/error_codes.pb.h

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: tensorflow/core/lib/core/error_codes.proto

// #ifndef PROTOBUF_tensorflow_2fcore_2flib_2fcore_2ferror_5fcodes_2eproto__INCLUDED
// #define PROTOBUF_tensorflow_2fcore_2flib_2fcore_2ferror_5fcodes_2eproto__INCLUDED

// #include 

// #include 

// #if GOOGLE_PROTOBUF_VERSION < 3000000
// #error This file was generated by a newer version of protoc which is
// #error incompatible with your Protocol Buffer headers.  Please update
// #error your headers.
// #endif
// #if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
// #error This file was generated by an older version of protoc which is
// #error incompatible with your Protocol Buffer headers.  Please
// #error regenerate this file with a newer version of protoc.
// #endif

// #include 
// #include 
// #include 
// #include 
// #include 
// #include 
// #include 
// @@protoc_insertion_point(includes)

// Internal implementation detail -- do not call these.
@Namespace("tensorflow::error") public static native void protobuf_AddDesc_tensorflow_2fcore_2flib_2fcore_2ferror_5fcodes_2eproto();
@Namespace("tensorflow::error") public static native void protobuf_AssignDesc_tensorflow_2fcore_2flib_2fcore_2ferror_5fcodes_2eproto();
@Namespace("tensorflow::error") public static native void protobuf_ShutdownFile_tensorflow_2fcore_2flib_2fcore_2ferror_5fcodes_2eproto();


/** enum tensorflow::error::Code */
public static final int
  OK = 0,
  CANCELLED = 1,
  UNKNOWN = 2,
  INVALID_ARGUMENT = 3,
  DEADLINE_EXCEEDED = 4,
  NOT_FOUND = 5,
  ALREADY_EXISTS = 6,
  PERMISSION_DENIED = 7,
  UNAUTHENTICATED = 16,
  RESOURCE_EXHAUSTED = 8,
  FAILED_PRECONDITION = 9,
  ABORTED = 10,
  OUT_OF_RANGE = 11,
  UNIMPLEMENTED = 12,
  INTERNAL = 13,
  UNAVAILABLE = 14,
  DATA_LOSS = 15,
  DO_NOT_USE_RESERVED_FOR_FUTURE_EXPANSION_USE_DEFAULT_IN_SWITCH_INSTEAD_ = 20,
  Code_INT_MIN_SENTINEL_DO_NOT_USE_ =kint32min,
  Code_INT_MAX_SENTINEL_DO_NOT_USE_ =kint32max;
@Namespace("tensorflow::error") public static native @Cast("bool") boolean Code_IsValid(int value);
@Namespace("tensorflow::error") @MemberGetter public static native @Cast("const tensorflow::error::Code") int Code_MIN();
@Namespace("tensorflow::error") @MemberGetter public static native @Cast("const tensorflow::error::Code") int Code_MAX();
@Namespace("tensorflow::error") @MemberGetter public static native int Code_ARRAYSIZE();

@Namespace("tensorflow::error") public static native @Cast("const google::protobuf::EnumDescriptor*") Pointer Code_descriptor();
@Namespace("tensorflow::error") public static native @StdString BytePointer Code_Name(@Cast("tensorflow::error::Code") int value);
@Namespace("tensorflow::error") public static native @Cast("bool") boolean Code_Parse(
    @StdString BytePointer name, @Cast("tensorflow::error::Code*") IntPointer value);
@Namespace("tensorflow::error") public static native @Cast("bool") boolean Code_Parse(
    @StdString String name, @Cast("tensorflow::error::Code*") IntBuffer value);
@Namespace("tensorflow::error") public static native @Cast("bool") boolean Code_Parse(
    @StdString BytePointer name, @Cast("tensorflow::error::Code*") int... value);
@Namespace("tensorflow::error") public static native @Cast("bool") boolean Code_Parse(
    @StdString String name, @Cast("tensorflow::error::Code*") IntPointer value);
@Namespace("tensorflow::error") public static native @Cast("bool") boolean Code_Parse(
    @StdString BytePointer name, @Cast("tensorflow::error::Code*") IntBuffer value);
@Namespace("tensorflow::error") public static native @Cast("bool") boolean Code_Parse(
    @StdString String name, @Cast("tensorflow::error::Code*") int... value);
// ===================================================================


// ===================================================================


// ===================================================================

// #if !PROTOBUF_INLINE_NOT_IN_HEADERS
// #endif  // !PROTOBUF_INLINE_NOT_IN_HEADERS

// @@protoc_insertion_point(namespace_scope)

  // namespace error
  // namespace tensorflow

// #ifndef SWIG
// #endif  // SWIG

// @@protoc_insertion_point(global_scope)

// #endif  // PROTOBUF_tensorflow_2fcore_2flib_2fcore_2ferror_5fcodes_2eproto__INCLUDED


// Parsed from tensorflow/core/platform/logging.h

/* Copyright 2015 Google Inc. 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_PLATFORM_LOGGING_H_
// #define TENSORFLOW_PLATFORM_LOGGING_H_

// #include "tensorflow/core/platform/platform.h"  // To pick up PLATFORM_define

// #if defined(PLATFORM_GOOGLE) || defined(PLATFORM_GOOGLE_ANDROID)
// #include "tensorflow/core/platform/google/build_config/logging.h"
// #else
// #include "tensorflow/core/platform/default/logging.h"
// #endif

// Some platforms require that filenames be of a certain form when
// used for logging.  This function is invoked to allow platforms to
// adjust the filename used for logging appropriately, if necessary
// (most ports can just do nothing).  If any changes are necessary, the
// implementation should mutate "*filename" appropriately.
@Namespace("tensorflow::port") public static native void AdjustFilenameForLogging(@StdString @Cast({"char*", "std::string*"}) BytePointer filename);

  // namespace port
  // namespace tensorflow

// #endif  // TENSORFLOW_PLATFORM_LOGGING_H_


// Parsed from tensorflow/core/lib/core/status.h

/* Copyright 2015 Google Inc. 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_CORE_LIB_CORE_STATUS_H_
// #define TENSORFLOW_CORE_LIB_CORE_STATUS_H_

// #include 
// #include 
// #include 
// #include "tensorflow/core/lib/core/error_codes.pb.h"
// #include "tensorflow/core/lib/core/stringpiece.h"
// #include "tensorflow/core/platform/logging.h"

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

  /** Create a success status. */
  public Status() { super((Pointer)null); allocate(); }
  private native void allocate();

  /** \brief Create a status with the specified error code and msg as a
   *  human-readable string containing more detailed information. */
  public Status(@Cast("tensorflow::error::Code") int code, @StringPiece BytePointer msg) { super((Pointer)null); allocate(code, msg); }
  private native void allocate(@Cast("tensorflow::error::Code") int code, @StringPiece BytePointer msg);
  public Status(@Cast("tensorflow::error::Code") int code, @StringPiece String msg) { super((Pointer)null); allocate(code, msg); }
  private native void allocate(@Cast("tensorflow::error::Code") int code, @StringPiece String msg);

  /** Copy the specified status. */
  public Status(@Const @ByRef Status s) { super((Pointer)null); allocate(s); }
  private native void allocate(@Const @ByRef Status s);
  public native @Name("operator =") void put(@Const @ByRef Status s);

  public static native @ByVal Status OK();

  /** Returns true iff the status indicates success. */
  public native @Cast("bool") boolean ok();

  public native @Cast("tensorflow::error::Code") int code();

  public native @StdString BytePointer error_message();

  public native @Cast("bool") @Name("operator ==") boolean equals(@Const @ByRef Status x);
  
  ///
  public native @Cast("bool") @Name("operator !=") boolean notEquals(@Const @ByRef Status x);

  /** \brief If {@code ok()}, stores {@code new_status} into {@code *this}.  If {@code !ok()},
   *  preserves the current status, but may augment with additional
   *  information about {@code new_status}.
   * 
   *  Convenient way of keeping track of the first error encountered.
   *  Instead of:
   *    {@code if (overall_status.ok()) overall_status = new_status}
   *  Use:
   *    {@code overall_status.Update(new_status);} */
  public native void Update(@Const @ByRef Status new_status);

  /** \brief Return a string representation of this status suitable for
   *  printing. Returns the string {@code "OK"} for success. */
  public native @StdString BytePointer ToString();
}









@Namespace("tensorflow") public static native @Cast("std::ostream*") @ByRef @Name("operator <<") Pointer shiftLeft(@Cast("std::ostream*") @ByRef Pointer os, @Const @ByRef Status x);

public static native void TF_CHECK_OK(@ByVal Status val);
public static native void TF_QCHECK_OK(@ByVal Status val);

  // namespace tensorflow

// #endif  // TENSORFLOW_CORE_LIB_CORE_STATUS_H_


// Parsed from tensorflow/core/platform/protobuf.h

/* Copyright 2015 Google Inc. 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_PLATFORM_PROTOBUF_H_
// #define TENSORFLOW_PLATFORM_PROTOBUF_H_

// #include "tensorflow/core/platform/platform.h"
// #include "tensorflow/core/platform/types.h"

// Import whatever namespace protobuf comes from into the
// ::tensorflow::protobuf namespace.
//
// TensorFlow code should use the ::tensorflow::protobuf namespace to
// refer to all protobuf APIs.

// #if defined(PLATFORM_GOOGLE)
// #include "tensorflow/core/platform/google/build_config/protobuf.h"
// #elif defined(PLATFORM_GOOGLE_ANDROID)
// #include "tensorflow/core/platform/google/build_config/protobuf_android.h"
// #else
// #include "tensorflow/core/platform/default/protobuf.h"
// #endif
// Parses a protocol buffer contained in a string in the binary wire format.
// Returns true on success. Note: Unlike protobuf's builtin ParseFromString,
// this function has no size restrictions on the total size of the encoded
// protocol buffer.
@Namespace("tensorflow") public static native @Cast("bool") boolean ParseProtoUnlimited(@Cast("tensorflow::protobuf::Message*") Pointer proto, @StdString BytePointer serialized);
@Namespace("tensorflow") public static native @Cast("bool") boolean ParseProtoUnlimited(@Cast("tensorflow::protobuf::Message*") Pointer proto, @StdString String serialized);
@Namespace("tensorflow") public static native @Cast("bool") boolean ParseProtoUnlimited(@Cast("tensorflow::protobuf::Message*") Pointer proto, @Const Pointer serialized,
                         @Cast("size_t") long size);
  // namespace tensorflow

// #endif  // TENSORFLOW_PLATFORM_PROTOBUF_H_


// Parsed from tensorflow/core/platform/file_system.h

/* Copyright 2015 Google Inc. 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_CORE_PLATFORM_FILE_SYSTEM_H_
// #define TENSORFLOW_CORE_PLATFORM_FILE_SYSTEM_H_

// #include 
// #include 
// #include 
// #include 
// #include 
// #include "tensorflow/core/lib/core/errors.h"
// #include "tensorflow/core/lib/core/status.h"
// #include "tensorflow/core/lib/core/stringpiece.h"
// #include "tensorflow/core/platform/macros.h"
// #include "tensorflow/core/platform/protobuf.h"
// #include "tensorflow/core/platform/types.h"

/** An generic interface for accessing a file system. */
@Namespace("tensorflow") public static class FileSystem extends Pointer {
    static { Loader.load(); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public FileSystem(Pointer p) { super(p); }


  /** The following functions are the implementations used by the corresponding
   *  functions in the Env class. */
  public native @ByVal Status NewRandomAccessFile(@StdString BytePointer fname,
                                       @Cast("tensorflow::RandomAccessFile**") PointerPointer result);
  public native @ByVal Status NewRandomAccessFile(@StdString BytePointer fname,
                                       @ByPtrPtr RandomAccessFile result);
  public native @ByVal Status NewRandomAccessFile(@StdString String fname,
                                       @ByPtrPtr RandomAccessFile result);

  public native @ByVal Status NewWritableFile(@StdString BytePointer fname,
                                   @Cast("tensorflow::WritableFile**") PointerPointer result);
  public native @ByVal Status NewWritableFile(@StdString BytePointer fname,
                                   @ByPtrPtr WritableFile result);
  public native @ByVal Status NewWritableFile(@StdString String fname,
                                   @ByPtrPtr WritableFile result);

  public native @ByVal Status NewAppendableFile(@StdString BytePointer fname,
                                     @Cast("tensorflow::WritableFile**") PointerPointer result);
  public native @ByVal Status NewAppendableFile(@StdString BytePointer fname,
                                     @ByPtrPtr WritableFile result);
  public native @ByVal Status NewAppendableFile(@StdString String fname,
                                     @ByPtrPtr WritableFile result);

  public native @ByVal Status NewReadOnlyMemoryRegionFromFile(
        @StdString BytePointer fname, @Cast("tensorflow::ReadOnlyMemoryRegion**") PointerPointer result);
  public native @ByVal Status NewReadOnlyMemoryRegionFromFile(
        @StdString BytePointer fname, @ByPtrPtr ReadOnlyMemoryRegion result);
  public native @ByVal Status NewReadOnlyMemoryRegionFromFile(
        @StdString String fname, @ByPtrPtr ReadOnlyMemoryRegion result);

  public native @Cast("bool") boolean FileExists(@StdString BytePointer fname);
  public native @Cast("bool") boolean FileExists(@StdString String fname);

  public native @ByVal Status GetChildren(@StdString BytePointer dir,
                               StringVector result);
  public native @ByVal Status GetChildren(@StdString String dir,
                               StringVector result);

  public native @ByVal Status DeleteFile(@StdString BytePointer fname);
  public native @ByVal Status DeleteFile(@StdString String fname);

  public native @ByVal Status CreateDir(@StdString BytePointer dirname);
  public native @ByVal Status CreateDir(@StdString String dirname);

  public native @ByVal Status DeleteDir(@StdString BytePointer dirname);
  public native @ByVal Status DeleteDir(@StdString String dirname);

  public native @ByVal Status GetFileSize(@StdString BytePointer fname, @Cast("tensorflow::uint64*") LongPointer file_size);
  public native @ByVal Status GetFileSize(@StdString String fname, @Cast("tensorflow::uint64*") LongBuffer file_size);
  public native @ByVal Status GetFileSize(@StdString BytePointer fname, @Cast("tensorflow::uint64*") long... file_size);
  public native @ByVal Status GetFileSize(@StdString String fname, @Cast("tensorflow::uint64*") LongPointer file_size);
  public native @ByVal Status GetFileSize(@StdString BytePointer fname, @Cast("tensorflow::uint64*") LongBuffer file_size);
  public native @ByVal Status GetFileSize(@StdString String fname, @Cast("tensorflow::uint64*") long... file_size);

  public native @ByVal Status RenameFile(@StdString BytePointer src, @StdString BytePointer target);
  public native @ByVal Status RenameFile(@StdString String src, @StdString String target);

  // Translate an URI to a filename usable by the FileSystem implementation. The
  // implementation in this class returns the name as-is.
  public native @StdString BytePointer TranslateName(@StdString BytePointer name);
  public native @StdString String TranslateName(@StdString String name);
}

// Degenerate file system that provides no implementations.
@Namespace("tensorflow") public static class NullFileSystem extends FileSystem {
    static { Loader.load(); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public NullFileSystem(Pointer p) { super(p); }
    /** Native array allocator. Access with {@link Pointer#position(long)}. */
    public NullFileSystem(long size) { super((Pointer)null); allocateArray(size); }
    private native void allocateArray(long size);
    @Override public NullFileSystem position(long position) {
        return (NullFileSystem)super.position(position);
    }

  public NullFileSystem() { super((Pointer)null); allocate(); }
  private native void allocate();

  public native @ByVal Status NewRandomAccessFile(@StdString BytePointer fname,
                               @Cast("tensorflow::RandomAccessFile**") PointerPointer result);
  public native @ByVal Status NewRandomAccessFile(@StdString BytePointer fname,
                               @ByPtrPtr RandomAccessFile result);
  public native @ByVal Status NewRandomAccessFile(@StdString String fname,
                               @ByPtrPtr RandomAccessFile result);

  public native @ByVal Status NewWritableFile(@StdString BytePointer fname, @Cast("tensorflow::WritableFile**") PointerPointer result);
  public native @ByVal Status NewWritableFile(@StdString BytePointer fname, @ByPtrPtr WritableFile result);
  public native @ByVal Status NewWritableFile(@StdString String fname, @ByPtrPtr WritableFile result);

  public native @ByVal Status NewAppendableFile(@StdString BytePointer fname,
                             @Cast("tensorflow::WritableFile**") PointerPointer result);
  public native @ByVal Status NewAppendableFile(@StdString BytePointer fname,
                             @ByPtrPtr WritableFile result);
  public native @ByVal Status NewAppendableFile(@StdString String fname,
                             @ByPtrPtr WritableFile result);

  public native @ByVal Status NewReadOnlyMemoryRegionFromFile(
        @StdString BytePointer fname, @Cast("tensorflow::ReadOnlyMemoryRegion**") PointerPointer result);
  public native @ByVal Status NewReadOnlyMemoryRegionFromFile(
        @StdString BytePointer fname, @ByPtrPtr ReadOnlyMemoryRegion result);
  public native @ByVal Status NewReadOnlyMemoryRegionFromFile(
        @StdString String fname, @ByPtrPtr ReadOnlyMemoryRegion result);

  public native @Cast("bool") boolean FileExists(@StdString BytePointer fname);
  public native @Cast("bool") boolean FileExists(@StdString String fname);

  public native @ByVal Status GetChildren(@StdString BytePointer dir, StringVector result);
  public native @ByVal Status GetChildren(@StdString String dir, StringVector result);

  public native @ByVal Status DeleteFile(@StdString BytePointer fname);
  public native @ByVal Status DeleteFile(@StdString String fname);

  public native @ByVal Status CreateDir(@StdString BytePointer dirname);
  public native @ByVal Status CreateDir(@StdString String dirname);

  public native @ByVal Status DeleteDir(@StdString BytePointer dirname);
  public native @ByVal Status DeleteDir(@StdString String dirname);

  public native @ByVal Status GetFileSize(@StdString BytePointer fname, @Cast("tensorflow::uint64*") LongPointer file_size);
  public native @ByVal Status GetFileSize(@StdString String fname, @Cast("tensorflow::uint64*") LongBuffer file_size);
  public native @ByVal Status GetFileSize(@StdString BytePointer fname, @Cast("tensorflow::uint64*") long... file_size);
  public native @ByVal Status GetFileSize(@StdString String fname, @Cast("tensorflow::uint64*") LongPointer file_size);
  public native @ByVal Status GetFileSize(@StdString BytePointer fname, @Cast("tensorflow::uint64*") LongBuffer file_size);
  public native @ByVal Status GetFileSize(@StdString String fname, @Cast("tensorflow::uint64*") long... file_size);

  public native @ByVal Status RenameFile(@StdString BytePointer src, @StdString BytePointer target);
  public native @ByVal Status RenameFile(@StdString String src, @StdString String target);
}

/** A file abstraction for randomly reading the contents of a file. */
@Namespace("tensorflow") public static class RandomAccessFile extends Pointer {
    static { Loader.load(); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public RandomAccessFile(Pointer p) { super(p); }


  /** \brief Reads up to {@code n} bytes from the file starting at {@code offset}.
   * 
   *  {@code scratch[0..n-1]} may be written by this routine.  Sets {@code *result}
   *  to the data that was read (including if fewer than {@code n} bytes were
   *  successfully read).  May set {@code *result} to point at data in
   *  {@code scratch[0..n-1]}, so {@code scratch[0..n-1]} must be live when
   *  {@code *result} is used.
   * 
   *  On OK returned status: {@code n} bytes have been stored in {@code *result}.
   *  On non-OK returned status: {@code [0..n]} bytes have been stored in {@code *result}.
   * 
   *  Returns {@code OUT_OF_RANGE} if fewer than n bytes were stored in {@code *result}
   *  because of EOF.
   * 
   *  Safe for concurrent use by multiple threads. */
  public native @ByVal Status Read(@Cast("tensorflow::uint64") long offset, @Cast("size_t") long n, @StringPiece BytePointer result,
                        @Cast("char*") BytePointer scratch);
  public native @ByVal Status Read(@Cast("tensorflow::uint64") long offset, @Cast("size_t") long n, @StringPiece BytePointer result,
                        @Cast("char*") ByteBuffer scratch);
  public native @ByVal Status Read(@Cast("tensorflow::uint64") long offset, @Cast("size_t") long n, @StringPiece BytePointer result,
                        @Cast("char*") byte[] scratch);
}

/** \brief A file abstraction for sequential writing.
 * 
 *  The implementation must provide buffering since callers may append
 *  small fragments at a time to the file. */
@Namespace("tensorflow") public static class WritableFile extends Pointer {
    static { Loader.load(); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public WritableFile(Pointer p) { super(p); }


  public native @ByVal Status Append(@StringPiece BytePointer data);
  public native @ByVal Status Append(@StringPiece String data);
  public native @ByVal Status Close();
  public native @ByVal Status Flush();
  public native @ByVal Status Sync();
}

/** \brief A readonly memmapped file abstraction.
 * 
 *  The implementation must guarantee that all memory is accessable when the
 *  object exists, independently from the Env that created it. */
@Namespace("tensorflow") public static class ReadOnlyMemoryRegion extends Pointer {
    static { Loader.load(); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public ReadOnlyMemoryRegion(Pointer p) { super(p); }

  public native @Const Pointer data();
  public native @Cast("tensorflow::uint64") long length();
}

/** \brief A registry for file system implementations.
 * 
 *  Filenames are specified as an URI, which is of the form
 *  [scheme://].
 *  File system implementations are registered using the REGISTER_FILE_SYSTEM
 *  macro, providing the 'scheme' as the key. */
@Namespace("tensorflow") public static class FileSystemRegistry extends Pointer {
    static { Loader.load(); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public FileSystemRegistry(Pointer p) { super(p); }

  public native void Register(@StdString BytePointer scheme, @ByVal @Cast("tensorflow::FileSystemRegistry::Factory*") Fn factory);
  public native void Register(@StdString String scheme, @ByVal @Cast("tensorflow::FileSystemRegistry::Factory*") Fn factory);
  public native FileSystem Lookup(@StdString BytePointer scheme);
  public native FileSystem Lookup(@StdString String scheme);
  public native @ByVal Status GetRegisteredFileSystemSchemes(
        StringVector schemes);
}

// Given URI of the form [scheme://], return 'scheme'.
@Namespace("tensorflow") public static native @StdString BytePointer GetSchemeFromURI(@StdString BytePointer name);
@Namespace("tensorflow") public static native @StdString String GetSchemeFromURI(@StdString String name);

// Given URI of the form [scheme://], return 'filename'.
@Namespace("tensorflow") public static native @StdString BytePointer GetNameFromURI(@StdString BytePointer name);
@Namespace("tensorflow") public static native @StdString String GetNameFromURI(@StdString String name);

  // namespace tensorflow

// #endif  // TENSORFLOW_CORE_PLATFORM_FILE_SYSTEM_H_


// Parsed from tensorflow/core/platform/env.h

/* Copyright 2015 Google Inc. 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_CORE_PLATFORM_ENV_H_
// #define TENSORFLOW_CORE_PLATFORM_ENV_H_

// #include 
// #include 
// #include 
// #include 
// #include 
// #include "tensorflow/core/lib/core/errors.h"
// #include "tensorflow/core/lib/core/status.h"
// #include "tensorflow/core/lib/core/stringpiece.h"
// #include "tensorflow/core/platform/file_system.h"
// #include "tensorflow/core/platform/macros.h"
// #include "tensorflow/core/platform/mutex.h"
// #include "tensorflow/core/platform/protobuf.h"
// #include "tensorflow/core/platform/types.h"

/** \brief An interface used by the tensorflow implementation to
 *  access operating system functionality like the filesystem etc.
 * 
 *  Callers may wish to provide a custom Env object to get fine grain
 *  control.
 * 
 *  All Env implementations are safe for concurrent access from
 *  multiple threads without any external synchronization. */
@Namespace("tensorflow") @NoOffset public static class Env extends Pointer {
    static { Loader.load(); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public Env(Pointer p) { super(p); }


  /** \brief Returns a default environment suitable for the current operating
   *  system.
   * 
   *  Sophisticated users may wish to provide their own Env
   *  implementation instead of relying on this default environment.
   * 
   *  The result of Default() belongs to this library and must never be deleted. */
  public static native Env Default();

  /** \brief Returns the FileSystem object to handle operations on the file
   *  specified by 'fname'. The FileSystem object is used as the implementation
   *  for the file system related (non-virtual) functions that follow.
   *  Returned FileSystem object is still owned by the Env object and will */
  // (might) be destroyed when the environment is destroyed.
  public native @ByVal Status GetFileSystemForFile(@StdString BytePointer fname, @Cast("tensorflow::FileSystem**") PointerPointer result);
  public native @ByVal Status GetFileSystemForFile(@StdString BytePointer fname, @ByPtrPtr FileSystem result);
  public native @ByVal Status GetFileSystemForFile(@StdString String fname, @ByPtrPtr FileSystem result);

  /** \brief Returns the file system schemes registered for this Env. */
  public native @ByVal Status GetRegisteredFileSystemSchemes(StringVector schemes);

  // \brief Register a file system for a scheme.
  
  ///
  ///
  public native void RegisterFileSystem(@StdString BytePointer scheme,
                                    @ByVal @Cast("tensorflow::FileSystemRegistry::Factory*") Fn factory);
  public native void RegisterFileSystem(@StdString String scheme,
                                    @ByVal @Cast("tensorflow::FileSystemRegistry::Factory*") Fn factory);

  /** \brief Creates a brand new random access read-only file with the
   *  specified name.
   

* On success, stores a pointer to the new file in * *result and returns OK. On failure stores NULL in *result and * returns non-OK. If the file does not exist, returns a non-OK * status. * * The returned file may be concurrently accessed by multiple threads. * * The ownership of the returned RandomAccessFile is passed to the caller * and the object should be deleted when is not used. The file object * shouldn't live longer than the Env object. */ /// /// /// public native @ByVal Status NewRandomAccessFile(@StdString BytePointer fname, @Cast("tensorflow::RandomAccessFile**") PointerPointer result); public native @ByVal Status NewRandomAccessFile(@StdString BytePointer fname, @ByPtrPtr RandomAccessFile result); public native @ByVal Status NewRandomAccessFile(@StdString String fname, @ByPtrPtr RandomAccessFile result); /** \brief Creates an object that writes to a new file with the specified * name. * * Deletes any existing file with the same name and creates a * new file. On success, stores a pointer to the new file in * *result and returns OK. On failure stores NULL in *result and * returns non-OK. * * The returned file will only be accessed by one thread at a time. * * The ownership of the returned WritableFile is passed to the caller * and the object should be deleted when is not used. The file object * shouldn't live longer than the Env object. */ /// /// /// public native @ByVal Status NewWritableFile(@StdString BytePointer fname, @Cast("tensorflow::WritableFile**") PointerPointer result); public native @ByVal Status NewWritableFile(@StdString BytePointer fname, @ByPtrPtr WritableFile result); public native @ByVal Status NewWritableFile(@StdString String fname, @ByPtrPtr WritableFile result); /** \brief Creates an object that either appends to an existing file, or * writes to a new file (if the file does not exist to begin with). * * On success, stores a pointer to the new file in *result and * returns OK. On failure stores NULL in *result and returns * non-OK. * * The returned file will only be accessed by one thread at a time. * * The ownership of the returned WritableFile is passed to the caller * and the object should be deleted when is not used. The file object * shouldn't live longer than the Env object. */ /// /// /// public native @ByVal Status NewAppendableFile(@StdString BytePointer fname, @Cast("tensorflow::WritableFile**") PointerPointer result); public native @ByVal Status NewAppendableFile(@StdString BytePointer fname, @ByPtrPtr WritableFile result); public native @ByVal Status NewAppendableFile(@StdString String fname, @ByPtrPtr WritableFile result); /** \brief Creates a readonly region of memory with the file context. * * On success, it returns a pointer to read-only memory region * from the content of file fname. The ownership of the region is passed to * the caller. On failure stores nullptr in *result and returns non-OK. * * The returned memory region can be accessed from many threads in parallel. * * The ownership of the returned ReadOnlyMemoryRegion is passed to the caller * and the object should be deleted when is not used. The memory region * object shouldn't live longer than the Env object. */ public native @ByVal Status NewReadOnlyMemoryRegionFromFile(@StdString BytePointer fname, @Cast("tensorflow::ReadOnlyMemoryRegion**") PointerPointer result); public native @ByVal Status NewReadOnlyMemoryRegionFromFile(@StdString BytePointer fname, @ByPtrPtr ReadOnlyMemoryRegion result); public native @ByVal Status NewReadOnlyMemoryRegionFromFile(@StdString String fname, @ByPtrPtr ReadOnlyMemoryRegion result); /** Returns true iff the named file exists. */ /// public native @Cast("bool") boolean FileExists(@StdString BytePointer fname); public native @Cast("bool") boolean FileExists(@StdString String fname); /** \brief Stores in *result the names of the children of the specified * directory. The names are relative to "dir". * * Original contents of *results are dropped. */ public native @ByVal Status GetChildren(@StdString BytePointer dir, StringVector result); public native @ByVal Status GetChildren(@StdString String dir, StringVector result); /** Deletes the named file. */ public native @ByVal Status DeleteFile(@StdString BytePointer fname); public native @ByVal Status DeleteFile(@StdString String fname); /** Creates the specified directory. */ public native @ByVal Status CreateDir(@StdString BytePointer dirname); public native @ByVal Status CreateDir(@StdString String dirname); /** Deletes the specified directory. */ public native @ByVal Status DeleteDir(@StdString BytePointer dirname); public native @ByVal Status DeleteDir(@StdString String dirname); /** Stores the size of {@code fname} in {@code *file_size}. */ public native @ByVal Status GetFileSize(@StdString BytePointer fname, @Cast("tensorflow::uint64*") LongPointer file_size); public native @ByVal Status GetFileSize(@StdString String fname, @Cast("tensorflow::uint64*") LongBuffer file_size); public native @ByVal Status GetFileSize(@StdString BytePointer fname, @Cast("tensorflow::uint64*") long... file_size); public native @ByVal Status GetFileSize(@StdString String fname, @Cast("tensorflow::uint64*") LongPointer file_size); public native @ByVal Status GetFileSize(@StdString BytePointer fname, @Cast("tensorflow::uint64*") LongBuffer file_size); public native @ByVal Status GetFileSize(@StdString String fname, @Cast("tensorflow::uint64*") long... file_size); /** \brief Renames file src to target. If target already exists, it will be * replaced. */ public native @ByVal Status RenameFile(@StdString BytePointer src, @StdString BytePointer target); public native @ByVal Status RenameFile(@StdString String src, @StdString String target); // TODO(jeff,sanjay): Add back thread/thread-pool support if needed. // TODO(jeff,sanjay): if needed, tighten spec so relative to epoch, or // provide a routine to get the absolute time. /** \brief Returns the number of micro-seconds since some fixed point in * time. Only useful for computing deltas of time. */ public native @Cast("tensorflow::uint64") long NowMicros(); /** Sleeps/delays the thread for the prescribed number of micro-seconds. */ /// public native void SleepForMicroseconds(int micros); /** \brief Returns a new thread that is running fn() and is identified * (for debugging/performance-analysis) by "name". * * Caller takes ownership of the result and must delete it eventually * (the deletion will block until fn() stops running). */ public native Thread StartThread(@Const @ByRef ThreadOptions thread_options, @StdString BytePointer name, @ByVal Fn fn); public native Thread StartThread(@Const @ByRef ThreadOptions thread_options, @StdString String name, @ByVal Fn fn); // \brief Schedules the given closure on a thread-pool. // // NOTE(mrry): This closure may block. public native void SchedClosure(@ByVal Fn closure); // \brief Schedules the given closure on a thread-pool after the given number // of microseconds. // // NOTE(mrry): This closure must not block. public native void SchedClosureAfter(int micros, @ByVal Fn closure); // \brief Load a dynamic library. // // Pass "library_filename" to a platform-specific mechanism for dynamically // loading a library. The rules for determining the exact location of the // library are platform-specific and are not documented here. // // On success, returns a handle to the library in "*handle" and returns // OK from the function. // Otherwise returns nullptr in "*handle" and an error status from the // function. public native @ByVal Status LoadLibrary(@Cast("const char*") BytePointer library_filename, @Cast("void**") PointerPointer handle); public native @ByVal Status LoadLibrary(@Cast("const char*") BytePointer library_filename, @Cast("void**") @ByPtrPtr Pointer handle); public native @ByVal Status LoadLibrary(String library_filename, @Cast("void**") @ByPtrPtr Pointer handle); // \brief Get a pointer to a symbol from a dynamic library. // // "handle" should be a pointer returned from a previous call to LoadLibrary. // On success, store a pointer to the located symbol in "*symbol" and return // OK from the function. Otherwise, returns nullptr in "*symbol" and an error // status from the function. public native @ByVal Status GetSymbolFromLibrary(Pointer handle, @Cast("const char*") BytePointer symbol_name, @Cast("void**") PointerPointer symbol); public native @ByVal Status GetSymbolFromLibrary(Pointer handle, @Cast("const char*") BytePointer symbol_name, @Cast("void**") @ByPtrPtr Pointer symbol); public native @ByVal Status GetSymbolFromLibrary(Pointer handle, String symbol_name, @Cast("void**") @ByPtrPtr Pointer symbol); } /** \brief An implementation of Env that forwards all calls to another Env. * * May be useful to clients who wish to override just part of the * functionality of another Env. */ @Namespace("tensorflow") @NoOffset public static class EnvWrapper extends Env { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public EnvWrapper(Pointer p) { super(p); } /** Initializes an EnvWrapper that delegates all calls to *t */ public EnvWrapper(Env t) { super((Pointer)null); allocate(t); } private native void allocate(Env t); /** Returns the target to which this Env forwards all calls */ public native Env target(); public native @ByVal Status GetFileSystemForFile(@StdString BytePointer fname, @Cast("tensorflow::FileSystem**") PointerPointer result); public native @ByVal Status GetFileSystemForFile(@StdString BytePointer fname, @ByPtrPtr FileSystem result); public native @ByVal Status GetFileSystemForFile(@StdString String fname, @ByPtrPtr FileSystem result); public native @ByVal Status GetRegisteredFileSystemSchemes(StringVector schemes); public native void RegisterFileSystem(@StdString BytePointer scheme, @ByVal @Cast("tensorflow::FileSystemRegistry::Factory*") Fn factory); public native void RegisterFileSystem(@StdString String scheme, @ByVal @Cast("tensorflow::FileSystemRegistry::Factory*") Fn factory); public native @Cast("tensorflow::uint64") long NowMicros(); public native void SleepForMicroseconds(int micros); public native Thread StartThread(@Const @ByRef ThreadOptions thread_options, @StdString BytePointer name, @ByVal Fn fn); public native Thread StartThread(@Const @ByRef ThreadOptions thread_options, @StdString String name, @ByVal Fn fn); public native void SchedClosure(@ByVal Fn closure); public native void SchedClosureAfter(int micros, @ByVal Fn closure); public native @ByVal Status LoadLibrary(@Cast("const char*") BytePointer library_filename, @Cast("void**") PointerPointer handle); public native @ByVal Status LoadLibrary(@Cast("const char*") BytePointer library_filename, @Cast("void**") @ByPtrPtr Pointer handle); public native @ByVal Status LoadLibrary(String library_filename, @Cast("void**") @ByPtrPtr Pointer handle); public native @ByVal Status GetSymbolFromLibrary(Pointer handle, @Cast("const char*") BytePointer symbol_name, @Cast("void**") PointerPointer symbol); public native @ByVal Status GetSymbolFromLibrary(Pointer handle, @Cast("const char*") BytePointer symbol_name, @Cast("void**") @ByPtrPtr Pointer symbol); public native @ByVal Status GetSymbolFromLibrary(Pointer handle, String symbol_name, @Cast("void**") @ByPtrPtr Pointer symbol); } @Namespace("tensorflow") public static class Thread extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public Thread(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public Thread(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public Thread position(long position) { return (Thread)super.position(position); } public Thread() { super((Pointer)null); allocate(); } private native void allocate(); /** Blocks until the thread of control stops running. */ } /** \brief Options to configure a Thread. * * Note that the options are all hints, and the * underlying implementation may choose to ignore it. */ @Namespace("tensorflow") public static class ThreadOptions extends Pointer { static { Loader.load(); } /** Default native constructor. */ public ThreadOptions() { super((Pointer)null); allocate(); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public ThreadOptions(long size) { super((Pointer)null); allocateArray(size); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public ThreadOptions(Pointer p) { super(p); } private native void allocate(); private native void allocateArray(long size); @Override public ThreadOptions position(long position) { return (ThreadOptions)super.position(position); } /** Thread stack size to use (in bytes). */ public native @Cast("size_t") long stack_size(); public native ThreadOptions stack_size(long stack_size); // 0: use system default value /** Guard area size to use near thread stacks to use (in bytes) */ public native @Cast("size_t") long guard_size(); public native ThreadOptions guard_size(long guard_size); // 0: use system default value } /** A utility routine: reads contents of named file into {@code *data} */ @Namespace("tensorflow") public static native @ByVal Status ReadFileToString(Env env, @StdString BytePointer fname, @StdString @Cast({"char*", "std::string*"}) BytePointer data); @Namespace("tensorflow") public static native @ByVal Status ReadFileToString(Env env, @StdString String fname, @StdString @Cast({"char*", "std::string*"}) BytePointer data); /** A utility routine: write contents of {@code data} to file named {@code fname} * (overwriting existing contents, if any). */ @Namespace("tensorflow") public static native @ByVal Status WriteStringToFile(Env env, @StdString BytePointer fname, @StringPiece BytePointer data); @Namespace("tensorflow") public static native @ByVal Status WriteStringToFile(Env env, @StdString String fname, @StringPiece String data); /** Reads contents of named file and parse as binary encoded proto data * and store into {@code *proto}. */ @Namespace("tensorflow") public static native @ByVal Status ReadBinaryProto(Env env, @StdString BytePointer fname, @Cast("tensorflow::protobuf::MessageLite*") Pointer proto); @Namespace("tensorflow") public static native @ByVal Status ReadBinaryProto(Env env, @StdString String fname, @Cast("tensorflow::protobuf::MessageLite*") Pointer proto); // namespace register_file_system // namespace tensorflow // Register a FileSystem implementation for a scheme. Files with names that have // "scheme://" prefixes are routed to use this implementation. // #define REGISTER_FILE_SYSTEM_ENV(env, scheme, factory) // REGISTER_FILE_SYSTEM_UNIQ_HELPER(__COUNTER__, env, scheme, factory) // #define REGISTER_FILE_SYSTEM_UNIQ_HELPER(ctr, env, scheme, factory) // REGISTER_FILE_SYSTEM_UNIQ(ctr, env, scheme, factory) // #define REGISTER_FILE_SYSTEM_UNIQ(ctr, env, scheme, factory) // static ::tensorflow::register_file_system::Register // register_ff##ctr TF_ATTRIBUTE_UNUSED = // ::tensorflow::register_file_system::Register(env, scheme) // #define REGISTER_FILE_SYSTEM(scheme, factory) // REGISTER_FILE_SYSTEM_ENV(Env::Default(), scheme, factory); // #endif // TENSORFLOW_CORE_PLATFORM_ENV_H_ // Parsed from tensorflow/core/protobuf/config.pb.h // Generated by the protocol buffer compiler. DO NOT EDIT! // source: tensorflow/core/protobuf/config.proto // #ifndef PROTOBUF_tensorflow_2fcore_2fprotobuf_2fconfig_2eproto__INCLUDED // #define PROTOBUF_tensorflow_2fcore_2fprotobuf_2fconfig_2eproto__INCLUDED // #include // #include // #if GOOGLE_PROTOBUF_VERSION < 3000000 // #error This file was generated by a newer version of protoc which is // #error incompatible with your Protocol Buffer headers. Please update // #error your headers. // #endif // #if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION // #error This file was generated by an older version of protoc which is // #error incompatible with your Protocol Buffer headers. Please // #error regenerate this file with a newer version of protoc. // #endif // #include // #include // #include // #include // #include // #include // #include // #include // #include // #include // #include // #include "tensorflow/core/framework/step_stats.pb.h" // @@protoc_insertion_point(includes) // Internal implementation detail -- do not call these. @Namespace("tensorflow") public static native void protobuf_AddDesc_tensorflow_2fcore_2fprotobuf_2fconfig_2eproto(); @Namespace("tensorflow") public static native void protobuf_AssignDesc_tensorflow_2fcore_2fprotobuf_2fconfig_2eproto(); @Namespace("tensorflow") public static native void protobuf_ShutdownFile_tensorflow_2fcore_2fprotobuf_2fconfig_2eproto(); /** enum tensorflow::OptimizerOptions_Level */ public static final int OptimizerOptions_Level_L1 = 0, OptimizerOptions_Level_L0 = -1, OptimizerOptions_Level_OptimizerOptions_Level_INT_MIN_SENTINEL_DO_NOT_USE_ =kint32min, OptimizerOptions_Level_OptimizerOptions_Level_INT_MAX_SENTINEL_DO_NOT_USE_ =kint32max; @Namespace("tensorflow") public static native @Cast("bool") boolean OptimizerOptions_Level_IsValid(int value); @Namespace("tensorflow") @MemberGetter public static native @Cast("const tensorflow::OptimizerOptions_Level") int OptimizerOptions_Level_Level_MIN(); @Namespace("tensorflow") @MemberGetter public static native @Cast("const tensorflow::OptimizerOptions_Level") int OptimizerOptions_Level_Level_MAX(); @Namespace("tensorflow") @MemberGetter public static native int OptimizerOptions_Level_Level_ARRAYSIZE(); @Namespace("tensorflow") public static native @Cast("const google::protobuf::EnumDescriptor*") Pointer OptimizerOptions_Level_descriptor(); @Namespace("tensorflow") public static native @StdString BytePointer OptimizerOptions_Level_Name(@Cast("tensorflow::OptimizerOptions_Level") int value); @Namespace("tensorflow") public static native @Cast("bool") boolean OptimizerOptions_Level_Parse( @StdString BytePointer name, @Cast("tensorflow::OptimizerOptions_Level*") IntPointer value); @Namespace("tensorflow") public static native @Cast("bool") boolean OptimizerOptions_Level_Parse( @StdString String name, @Cast("tensorflow::OptimizerOptions_Level*") IntBuffer value); @Namespace("tensorflow") public static native @Cast("bool") boolean OptimizerOptions_Level_Parse( @StdString BytePointer name, @Cast("tensorflow::OptimizerOptions_Level*") int... value); @Namespace("tensorflow") public static native @Cast("bool") boolean OptimizerOptions_Level_Parse( @StdString String name, @Cast("tensorflow::OptimizerOptions_Level*") IntPointer value); @Namespace("tensorflow") public static native @Cast("bool") boolean OptimizerOptions_Level_Parse( @StdString BytePointer name, @Cast("tensorflow::OptimizerOptions_Level*") IntBuffer value); @Namespace("tensorflow") public static native @Cast("bool") boolean OptimizerOptions_Level_Parse( @StdString String name, @Cast("tensorflow::OptimizerOptions_Level*") int... value); /** enum tensorflow::RunOptions_TraceLevel */ public static final int RunOptions_TraceLevel_NO_TRACE = 0, RunOptions_TraceLevel_FULL_TRACE = 1, RunOptions_TraceLevel_RunOptions_TraceLevel_INT_MIN_SENTINEL_DO_NOT_USE_ =kint32min, RunOptions_TraceLevel_RunOptions_TraceLevel_INT_MAX_SENTINEL_DO_NOT_USE_ =kint32max; @Namespace("tensorflow") public static native @Cast("bool") boolean RunOptions_TraceLevel_IsValid(int value); @Namespace("tensorflow") @MemberGetter public static native @Cast("const tensorflow::RunOptions_TraceLevel") int RunOptions_TraceLevel_TraceLevel_MIN(); @Namespace("tensorflow") @MemberGetter public static native @Cast("const tensorflow::RunOptions_TraceLevel") int RunOptions_TraceLevel_TraceLevel_MAX(); @Namespace("tensorflow") @MemberGetter public static native int RunOptions_TraceLevel_TraceLevel_ARRAYSIZE(); @Namespace("tensorflow") public static native @Cast("const google::protobuf::EnumDescriptor*") Pointer RunOptions_TraceLevel_descriptor(); @Namespace("tensorflow") public static native @StdString BytePointer RunOptions_TraceLevel_Name(@Cast("tensorflow::RunOptions_TraceLevel") int value); @Namespace("tensorflow") public static native @Cast("bool") boolean RunOptions_TraceLevel_Parse( @StdString BytePointer name, @Cast("tensorflow::RunOptions_TraceLevel*") IntPointer value); @Namespace("tensorflow") public static native @Cast("bool") boolean RunOptions_TraceLevel_Parse( @StdString String name, @Cast("tensorflow::RunOptions_TraceLevel*") IntBuffer value); @Namespace("tensorflow") public static native @Cast("bool") boolean RunOptions_TraceLevel_Parse( @StdString BytePointer name, @Cast("tensorflow::RunOptions_TraceLevel*") int... value); @Namespace("tensorflow") public static native @Cast("bool") boolean RunOptions_TraceLevel_Parse( @StdString String name, @Cast("tensorflow::RunOptions_TraceLevel*") IntPointer value); @Namespace("tensorflow") public static native @Cast("bool") boolean RunOptions_TraceLevel_Parse( @StdString BytePointer name, @Cast("tensorflow::RunOptions_TraceLevel*") IntBuffer value); @Namespace("tensorflow") public static native @Cast("bool") boolean RunOptions_TraceLevel_Parse( @StdString String name, @Cast("tensorflow::RunOptions_TraceLevel*") int... value); // =================================================================== @Namespace("tensorflow") @NoOffset public static class GPUOptions extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public GPUOptions(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public GPUOptions(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public GPUOptions position(long position) { return (GPUOptions)super.position(position); } public GPUOptions() { super((Pointer)null); allocate(); } private native void allocate(); public GPUOptions(@Const @ByRef GPUOptions from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef GPUOptions from); public native @ByRef @Name("operator =") GPUOptions put(@Const @ByRef GPUOptions from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef GPUOptions default_instance(); public native void Swap(GPUOptions other); // implements Message ---------------------------------------------- public native GPUOptions New(); public native GPUOptions New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef GPUOptions from); public native void MergeFrom(@Const @ByRef GPUOptions from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // optional double per_process_gpu_memory_fraction = 1; public native void clear_per_process_gpu_memory_fraction(); @MemberGetter public static native int kPerProcessGpuMemoryFractionFieldNumber(); public static final int kPerProcessGpuMemoryFractionFieldNumber = kPerProcessGpuMemoryFractionFieldNumber(); public native double per_process_gpu_memory_fraction(); public native void set_per_process_gpu_memory_fraction(double value); // optional string allocator_type = 2; public native void clear_allocator_type(); @MemberGetter public static native int kAllocatorTypeFieldNumber(); public static final int kAllocatorTypeFieldNumber = kAllocatorTypeFieldNumber(); public native @StdString BytePointer allocator_type(); public native void set_allocator_type(@StdString BytePointer value); public native void set_allocator_type(@StdString String value); public native void set_allocator_type(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_allocator_type(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_allocator_type(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_allocator_type(); public native void set_allocated_allocator_type(@StdString @Cast({"char*", "std::string*"}) BytePointer allocator_type); // optional int64 deferred_deletion_bytes = 3; public native void clear_deferred_deletion_bytes(); @MemberGetter public static native int kDeferredDeletionBytesFieldNumber(); public static final int kDeferredDeletionBytesFieldNumber = kDeferredDeletionBytesFieldNumber(); public native @Cast("google::protobuf::int64") long deferred_deletion_bytes(); public native void set_deferred_deletion_bytes(@Cast("google::protobuf::int64") long value); // optional bool allow_growth = 4; public native void clear_allow_growth(); @MemberGetter public static native int kAllowGrowthFieldNumber(); public static final int kAllowGrowthFieldNumber = kAllowGrowthFieldNumber(); public native @Cast("bool") boolean allow_growth(); public native void set_allow_growth(@Cast("bool") boolean value); } // ------------------------------------------------------------------- @Namespace("tensorflow") @NoOffset public static class OptimizerOptions extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public OptimizerOptions(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public OptimizerOptions(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public OptimizerOptions position(long position) { return (OptimizerOptions)super.position(position); } public OptimizerOptions() { super((Pointer)null); allocate(); } private native void allocate(); public OptimizerOptions(@Const @ByRef OptimizerOptions from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef OptimizerOptions from); public native @ByRef @Name("operator =") OptimizerOptions put(@Const @ByRef OptimizerOptions from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef OptimizerOptions default_instance(); public native void Swap(OptimizerOptions other); // implements Message ---------------------------------------------- public native OptimizerOptions New(); public native OptimizerOptions New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef OptimizerOptions from); public native void MergeFrom(@Const @ByRef OptimizerOptions from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- @MemberGetter public static native @Cast("const tensorflow::OptimizerOptions::Level") int L1(); public static final int L1 = L1(); @MemberGetter public static native @Cast("const tensorflow::OptimizerOptions::Level") int L0(); public static final int L0 = L0(); public static native @Cast("bool") boolean Level_IsValid(int value); @MemberGetter public static native @Cast("const tensorflow::OptimizerOptions::Level") int Level_MIN(); public static final int Level_MIN = Level_MIN(); @MemberGetter public static native @Cast("const tensorflow::OptimizerOptions::Level") int Level_MAX(); public static final int Level_MAX = Level_MAX(); @MemberGetter public static native int Level_ARRAYSIZE(); public static final int Level_ARRAYSIZE = Level_ARRAYSIZE(); public static native @Cast("const google::protobuf::EnumDescriptor*") Pointer Level_descriptor(); public static native @StdString BytePointer Level_Name(@Cast("tensorflow::OptimizerOptions::Level") int value); public static native @Cast("bool") boolean Level_Parse(@StdString BytePointer name, @Cast("tensorflow::OptimizerOptions::Level*") IntPointer value); public static native @Cast("bool") boolean Level_Parse(@StdString String name, @Cast("tensorflow::OptimizerOptions::Level*") IntBuffer value); public static native @Cast("bool") boolean Level_Parse(@StdString BytePointer name, @Cast("tensorflow::OptimizerOptions::Level*") int... value); public static native @Cast("bool") boolean Level_Parse(@StdString String name, @Cast("tensorflow::OptimizerOptions::Level*") IntPointer value); public static native @Cast("bool") boolean Level_Parse(@StdString BytePointer name, @Cast("tensorflow::OptimizerOptions::Level*") IntBuffer value); public static native @Cast("bool") boolean Level_Parse(@StdString String name, @Cast("tensorflow::OptimizerOptions::Level*") int... value); // accessors ------------------------------------------------------- // optional bool do_common_subexpression_elimination = 1; public native void clear_do_common_subexpression_elimination(); @MemberGetter public static native int kDoCommonSubexpressionEliminationFieldNumber(); public static final int kDoCommonSubexpressionEliminationFieldNumber = kDoCommonSubexpressionEliminationFieldNumber(); public native @Cast("bool") boolean do_common_subexpression_elimination(); public native void set_do_common_subexpression_elimination(@Cast("bool") boolean value); // optional bool do_constant_folding = 2; public native void clear_do_constant_folding(); @MemberGetter public static native int kDoConstantFoldingFieldNumber(); public static final int kDoConstantFoldingFieldNumber = kDoConstantFoldingFieldNumber(); public native @Cast("bool") boolean do_constant_folding(); public native void set_do_constant_folding(@Cast("bool") boolean value); // optional bool do_function_inlining = 4; public native void clear_do_function_inlining(); @MemberGetter public static native int kDoFunctionInliningFieldNumber(); public static final int kDoFunctionInliningFieldNumber = kDoFunctionInliningFieldNumber(); public native @Cast("bool") boolean do_function_inlining(); public native void set_do_function_inlining(@Cast("bool") boolean value); // optional .tensorflow.OptimizerOptions.Level opt_level = 3; public native void clear_opt_level(); @MemberGetter public static native int kOptLevelFieldNumber(); public static final int kOptLevelFieldNumber = kOptLevelFieldNumber(); public native @Cast("tensorflow::OptimizerOptions_Level") int opt_level(); public native void set_opt_level(@Cast("tensorflow::OptimizerOptions_Level") int value); } // ------------------------------------------------------------------- @Namespace("tensorflow") @NoOffset public static class GraphOptions extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public GraphOptions(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public GraphOptions(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public GraphOptions position(long position) { return (GraphOptions)super.position(position); } public GraphOptions() { super((Pointer)null); allocate(); } private native void allocate(); public GraphOptions(@Const @ByRef GraphOptions from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef GraphOptions from); public native @ByRef @Name("operator =") GraphOptions put(@Const @ByRef GraphOptions from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef GraphOptions default_instance(); public native void Swap(GraphOptions other); // implements Message ---------------------------------------------- public native GraphOptions New(); public native GraphOptions New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef GraphOptions from); public native void MergeFrom(@Const @ByRef GraphOptions from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // optional bool enable_recv_scheduling = 2; public native void clear_enable_recv_scheduling(); @MemberGetter public static native int kEnableRecvSchedulingFieldNumber(); public static final int kEnableRecvSchedulingFieldNumber = kEnableRecvSchedulingFieldNumber(); public native @Cast("bool") boolean enable_recv_scheduling(); public native void set_enable_recv_scheduling(@Cast("bool") boolean value); // optional .tensorflow.OptimizerOptions optimizer_options = 3; public native @Cast("bool") boolean has_optimizer_options(); public native void clear_optimizer_options(); @MemberGetter public static native int kOptimizerOptionsFieldNumber(); public static final int kOptimizerOptionsFieldNumber = kOptimizerOptionsFieldNumber(); public native @Const @ByRef OptimizerOptions optimizer_options(); public native OptimizerOptions mutable_optimizer_options(); public native OptimizerOptions release_optimizer_options(); public native void set_allocated_optimizer_options(OptimizerOptions optimizer_options); // optional bool build_cost_model = 4; public native void clear_build_cost_model(); @MemberGetter public static native int kBuildCostModelFieldNumber(); public static final int kBuildCostModelFieldNumber = kBuildCostModelFieldNumber(); public native @Cast("bool") boolean build_cost_model(); public native void set_build_cost_model(@Cast("bool") boolean value); } // ------------------------------------------------------------------- @Namespace("tensorflow") @NoOffset public static class ConfigProto extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public ConfigProto(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public ConfigProto(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public ConfigProto position(long position) { return (ConfigProto)super.position(position); } public ConfigProto() { super((Pointer)null); allocate(); } private native void allocate(); public ConfigProto(@Const @ByRef ConfigProto from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef ConfigProto from); public native @ByRef @Name("operator =") ConfigProto put(@Const @ByRef ConfigProto from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef ConfigProto default_instance(); public native void Swap(ConfigProto other); // implements Message ---------------------------------------------- public native ConfigProto New(); public native ConfigProto New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef ConfigProto from); public native void MergeFrom(@Const @ByRef ConfigProto from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // map device_count = 1; public native int device_count_size(); public native void clear_device_count(); @MemberGetter public static native int kDeviceCountFieldNumber(); public static final int kDeviceCountFieldNumber = kDeviceCountFieldNumber(); // optional int32 intra_op_parallelism_threads = 2; public native void clear_intra_op_parallelism_threads(); @MemberGetter public static native int kIntraOpParallelismThreadsFieldNumber(); public static final int kIntraOpParallelismThreadsFieldNumber = kIntraOpParallelismThreadsFieldNumber(); public native @Cast("google::protobuf::int32") int intra_op_parallelism_threads(); public native void set_intra_op_parallelism_threads(@Cast("google::protobuf::int32") int value); // optional int32 inter_op_parallelism_threads = 5; public native void clear_inter_op_parallelism_threads(); @MemberGetter public static native int kInterOpParallelismThreadsFieldNumber(); public static final int kInterOpParallelismThreadsFieldNumber = kInterOpParallelismThreadsFieldNumber(); public native @Cast("google::protobuf::int32") int inter_op_parallelism_threads(); public native void set_inter_op_parallelism_threads(@Cast("google::protobuf::int32") int value); // optional bool use_per_session_threads = 9; public native void clear_use_per_session_threads(); @MemberGetter public static native int kUsePerSessionThreadsFieldNumber(); public static final int kUsePerSessionThreadsFieldNumber = kUsePerSessionThreadsFieldNumber(); public native @Cast("bool") boolean use_per_session_threads(); public native void set_use_per_session_threads(@Cast("bool") boolean value); // optional int32 placement_period = 3; public native void clear_placement_period(); @MemberGetter public static native int kPlacementPeriodFieldNumber(); public static final int kPlacementPeriodFieldNumber = kPlacementPeriodFieldNumber(); public native @Cast("google::protobuf::int32") int placement_period(); public native void set_placement_period(@Cast("google::protobuf::int32") int value); // repeated string device_filters = 4; public native int device_filters_size(); public native void clear_device_filters(); @MemberGetter public static native int kDeviceFiltersFieldNumber(); public static final int kDeviceFiltersFieldNumber = kDeviceFiltersFieldNumber(); public native @StdString BytePointer device_filters(int index); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_device_filters(int index); public native void set_device_filters(int index, @StdString BytePointer value); public native void set_device_filters(int index, @StdString String value); public native void set_device_filters(int index, @Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_device_filters(int index, String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer add_device_filters(); public native void add_device_filters(@StdString BytePointer value); public native void add_device_filters(@StdString String value); public native void add_device_filters(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void add_device_filters(String value, @Cast("size_t") long size); // optional .tensorflow.GPUOptions gpu_options = 6; public native @Cast("bool") boolean has_gpu_options(); public native void clear_gpu_options(); @MemberGetter public static native int kGpuOptionsFieldNumber(); public static final int kGpuOptionsFieldNumber = kGpuOptionsFieldNumber(); public native @Const @ByRef GPUOptions gpu_options(); public native GPUOptions mutable_gpu_options(); public native GPUOptions release_gpu_options(); public native void set_allocated_gpu_options(GPUOptions gpu_options); // optional bool allow_soft_placement = 7; public native void clear_allow_soft_placement(); @MemberGetter public static native int kAllowSoftPlacementFieldNumber(); public static final int kAllowSoftPlacementFieldNumber = kAllowSoftPlacementFieldNumber(); public native @Cast("bool") boolean allow_soft_placement(); public native void set_allow_soft_placement(@Cast("bool") boolean value); // optional bool log_device_placement = 8; public native void clear_log_device_placement(); @MemberGetter public static native int kLogDevicePlacementFieldNumber(); public static final int kLogDevicePlacementFieldNumber = kLogDevicePlacementFieldNumber(); public native @Cast("bool") boolean log_device_placement(); public native void set_log_device_placement(@Cast("bool") boolean value); // optional .tensorflow.GraphOptions graph_options = 10; public native @Cast("bool") boolean has_graph_options(); public native void clear_graph_options(); @MemberGetter public static native int kGraphOptionsFieldNumber(); public static final int kGraphOptionsFieldNumber = kGraphOptionsFieldNumber(); public native @Const @ByRef GraphOptions graph_options(); public native GraphOptions mutable_graph_options(); public native GraphOptions release_graph_options(); public native void set_allocated_graph_options(GraphOptions graph_options); // optional int64 operation_timeout_in_ms = 11; public native void clear_operation_timeout_in_ms(); @MemberGetter public static native int kOperationTimeoutInMsFieldNumber(); public static final int kOperationTimeoutInMsFieldNumber = kOperationTimeoutInMsFieldNumber(); public native @Cast("google::protobuf::int64") long operation_timeout_in_ms(); public native void set_operation_timeout_in_ms(@Cast("google::protobuf::int64") long value); } // ------------------------------------------------------------------- @Namespace("tensorflow") @NoOffset public static class RunOptions extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public RunOptions(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public RunOptions(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public RunOptions position(long position) { return (RunOptions)super.position(position); } public RunOptions() { super((Pointer)null); allocate(); } private native void allocate(); public RunOptions(@Const @ByRef RunOptions from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef RunOptions from); public native @ByRef @Name("operator =") RunOptions put(@Const @ByRef RunOptions from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef RunOptions default_instance(); public native void Swap(RunOptions other); // implements Message ---------------------------------------------- public native RunOptions New(); public native RunOptions New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef RunOptions from); public native void MergeFrom(@Const @ByRef RunOptions from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- @MemberGetter public static native @Cast("const tensorflow::RunOptions::TraceLevel") int NO_TRACE(); public static final int NO_TRACE = NO_TRACE(); @MemberGetter public static native @Cast("const tensorflow::RunOptions::TraceLevel") int FULL_TRACE(); public static final int FULL_TRACE = FULL_TRACE(); public static native @Cast("bool") boolean TraceLevel_IsValid(int value); @MemberGetter public static native @Cast("const tensorflow::RunOptions::TraceLevel") int TraceLevel_MIN(); public static final int TraceLevel_MIN = TraceLevel_MIN(); @MemberGetter public static native @Cast("const tensorflow::RunOptions::TraceLevel") int TraceLevel_MAX(); public static final int TraceLevel_MAX = TraceLevel_MAX(); @MemberGetter public static native int TraceLevel_ARRAYSIZE(); public static final int TraceLevel_ARRAYSIZE = TraceLevel_ARRAYSIZE(); public static native @Cast("const google::protobuf::EnumDescriptor*") Pointer TraceLevel_descriptor(); public static native @StdString BytePointer TraceLevel_Name(@Cast("tensorflow::RunOptions::TraceLevel") int value); public static native @Cast("bool") boolean TraceLevel_Parse(@StdString BytePointer name, @Cast("tensorflow::RunOptions::TraceLevel*") IntPointer value); public static native @Cast("bool") boolean TraceLevel_Parse(@StdString String name, @Cast("tensorflow::RunOptions::TraceLevel*") IntBuffer value); public static native @Cast("bool") boolean TraceLevel_Parse(@StdString BytePointer name, @Cast("tensorflow::RunOptions::TraceLevel*") int... value); public static native @Cast("bool") boolean TraceLevel_Parse(@StdString String name, @Cast("tensorflow::RunOptions::TraceLevel*") IntPointer value); public static native @Cast("bool") boolean TraceLevel_Parse(@StdString BytePointer name, @Cast("tensorflow::RunOptions::TraceLevel*") IntBuffer value); public static native @Cast("bool") boolean TraceLevel_Parse(@StdString String name, @Cast("tensorflow::RunOptions::TraceLevel*") int... value); // accessors ------------------------------------------------------- // optional .tensorflow.RunOptions.TraceLevel trace_level = 1; public native void clear_trace_level(); @MemberGetter public static native int kTraceLevelFieldNumber(); public static final int kTraceLevelFieldNumber = kTraceLevelFieldNumber(); public native @Cast("tensorflow::RunOptions_TraceLevel") int trace_level(); public native void set_trace_level(@Cast("tensorflow::RunOptions_TraceLevel") int value); // optional int64 timeout_in_ms = 2; public native void clear_timeout_in_ms(); @MemberGetter public static native int kTimeoutInMsFieldNumber(); public static final int kTimeoutInMsFieldNumber = kTimeoutInMsFieldNumber(); public native @Cast("google::protobuf::int64") long timeout_in_ms(); public native void set_timeout_in_ms(@Cast("google::protobuf::int64") long value); } // ------------------------------------------------------------------- @Namespace("tensorflow") @NoOffset public static class RunMetadata extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public RunMetadata(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public RunMetadata(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public RunMetadata position(long position) { return (RunMetadata)super.position(position); } public RunMetadata() { super((Pointer)null); allocate(); } private native void allocate(); public RunMetadata(@Const @ByRef RunMetadata from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef RunMetadata from); public native @ByRef @Name("operator =") RunMetadata put(@Const @ByRef RunMetadata from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef RunMetadata default_instance(); public native void Swap(RunMetadata other); // implements Message ---------------------------------------------- public native RunMetadata New(); public native RunMetadata New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef RunMetadata from); public native void MergeFrom(@Const @ByRef RunMetadata from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // optional .tensorflow.StepStats step_stats = 1; public native @Cast("bool") boolean has_step_stats(); public native void clear_step_stats(); @MemberGetter public static native int kStepStatsFieldNumber(); public static final int kStepStatsFieldNumber = kStepStatsFieldNumber(); public native @Const @ByRef StepStats step_stats(); public native StepStats mutable_step_stats(); public native StepStats release_step_stats(); public native void set_allocated_step_stats(StepStats step_stats); } // =================================================================== // =================================================================== // #if !PROTOBUF_INLINE_NOT_IN_HEADERS // GPUOptions // optional double per_process_gpu_memory_fraction = 1; // optional string allocator_type = 2; // optional int64 deferred_deletion_bytes = 3; // optional bool allow_growth = 4; // ------------------------------------------------------------------- // OptimizerOptions // optional bool do_common_subexpression_elimination = 1; // optional bool do_constant_folding = 2; // optional bool do_function_inlining = 4; // optional .tensorflow.OptimizerOptions.Level opt_level = 3; // ------------------------------------------------------------------- // GraphOptions // optional bool enable_recv_scheduling = 2; // optional .tensorflow.OptimizerOptions optimizer_options = 3; // optional bool build_cost_model = 4; // ------------------------------------------------------------------- // ConfigProto // map device_count = 1; // optional int32 intra_op_parallelism_threads = 2; // optional int32 inter_op_parallelism_threads = 5; // optional bool use_per_session_threads = 9; // optional int32 placement_period = 3; // repeated string device_filters = 4; // optional .tensorflow.GPUOptions gpu_options = 6; // optional bool allow_soft_placement = 7; // optional bool log_device_placement = 8; // optional .tensorflow.GraphOptions graph_options = 10; // optional int64 operation_timeout_in_ms = 11; // ------------------------------------------------------------------- // RunOptions // optional .tensorflow.RunOptions.TraceLevel trace_level = 1; // optional int64 timeout_in_ms = 2; // ------------------------------------------------------------------- // RunMetadata // optional .tensorflow.StepStats step_stats = 1; // #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // @@protoc_insertion_point(namespace_scope) // namespace tensorflow // #ifndef SWIG // #endif // SWIG // @@protoc_insertion_point(global_scope) // #endif // PROTOBUF_tensorflow_2fcore_2fprotobuf_2fconfig_2eproto__INCLUDED // Parsed from tensorflow/core/framework/step_stats.pb.h // Generated by the protocol buffer compiler. DO NOT EDIT! // source: tensorflow/core/framework/step_stats.proto // #ifndef PROTOBUF_tensorflow_2fcore_2fframework_2fstep_5fstats_2eproto__INCLUDED // #define PROTOBUF_tensorflow_2fcore_2fframework_2fstep_5fstats_2eproto__INCLUDED // #include // #include // #if GOOGLE_PROTOBUF_VERSION < 3000000 // #error This file was generated by a newer version of protoc which is // #error incompatible with your Protocol Buffer headers. Please update // #error your headers. // #endif // #if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION // #error This file was generated by an older version of protoc which is // #error incompatible with your Protocol Buffer headers. Please // #error regenerate this file with a newer version of protoc. // #endif // #include // #include // #include // #include // #include // #include // #include // #include // #include "tensorflow/core/framework/allocation_description.pb.h" // #include "tensorflow/core/framework/tensor_description.pb.h" // @@protoc_insertion_point(includes) // Internal implementation detail -- do not call these. @Namespace("tensorflow") public static native void protobuf_AddDesc_tensorflow_2fcore_2fframework_2fstep_5fstats_2eproto(); @Namespace("tensorflow") public static native void protobuf_AssignDesc_tensorflow_2fcore_2fframework_2fstep_5fstats_2eproto(); @Namespace("tensorflow") public static native void protobuf_ShutdownFile_tensorflow_2fcore_2fframework_2fstep_5fstats_2eproto(); // =================================================================== @Namespace("tensorflow") @NoOffset public static class AllocatorMemoryUsed extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public AllocatorMemoryUsed(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public AllocatorMemoryUsed(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public AllocatorMemoryUsed position(long position) { return (AllocatorMemoryUsed)super.position(position); } public AllocatorMemoryUsed() { super((Pointer)null); allocate(); } private native void allocate(); public AllocatorMemoryUsed(@Const @ByRef AllocatorMemoryUsed from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef AllocatorMemoryUsed from); public native @ByRef @Name("operator =") AllocatorMemoryUsed put(@Const @ByRef AllocatorMemoryUsed from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef AllocatorMemoryUsed default_instance(); public native void Swap(AllocatorMemoryUsed other); // implements Message ---------------------------------------------- public native AllocatorMemoryUsed New(); public native AllocatorMemoryUsed New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef AllocatorMemoryUsed from); public native void MergeFrom(@Const @ByRef AllocatorMemoryUsed from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // optional string allocator_name = 1; public native void clear_allocator_name(); @MemberGetter public static native int kAllocatorNameFieldNumber(); public static final int kAllocatorNameFieldNumber = kAllocatorNameFieldNumber(); public native @StdString BytePointer allocator_name(); public native void set_allocator_name(@StdString BytePointer value); public native void set_allocator_name(@StdString String value); public native void set_allocator_name(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_allocator_name(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_allocator_name(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_allocator_name(); public native void set_allocated_allocator_name(@StdString @Cast({"char*", "std::string*"}) BytePointer allocator_name); // optional int64 total_bytes = 2; public native void clear_total_bytes(); @MemberGetter public static native int kTotalBytesFieldNumber(); public static final int kTotalBytesFieldNumber = kTotalBytesFieldNumber(); public native @Cast("google::protobuf::int64") long total_bytes(); public native void set_total_bytes(@Cast("google::protobuf::int64") long value); // optional int64 peak_bytes = 3; public native void clear_peak_bytes(); @MemberGetter public static native int kPeakBytesFieldNumber(); public static final int kPeakBytesFieldNumber = kPeakBytesFieldNumber(); public native @Cast("google::protobuf::int64") long peak_bytes(); public native void set_peak_bytes(@Cast("google::protobuf::int64") long value); } // ------------------------------------------------------------------- @Namespace("tensorflow") @NoOffset public static class NodeOutput extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public NodeOutput(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public NodeOutput(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public NodeOutput position(long position) { return (NodeOutput)super.position(position); } public NodeOutput() { super((Pointer)null); allocate(); } private native void allocate(); public NodeOutput(@Const @ByRef NodeOutput from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef NodeOutput from); public native @ByRef @Name("operator =") NodeOutput put(@Const @ByRef NodeOutput from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef NodeOutput default_instance(); public native void Swap(NodeOutput other); // implements Message ---------------------------------------------- public native NodeOutput New(); public native NodeOutput New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef NodeOutput from); public native void MergeFrom(@Const @ByRef NodeOutput from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // optional int32 slot = 1; public native void clear_slot(); @MemberGetter public static native int kSlotFieldNumber(); public static final int kSlotFieldNumber = kSlotFieldNumber(); public native @Cast("google::protobuf::int32") int slot(); public native void set_slot(@Cast("google::protobuf::int32") int value); // optional .tensorflow.TensorDescription tensor_description = 3; public native @Cast("bool") boolean has_tensor_description(); public native void clear_tensor_description(); @MemberGetter public static native int kTensorDescriptionFieldNumber(); public static final int kTensorDescriptionFieldNumber = kTensorDescriptionFieldNumber(); public native @Const @ByRef TensorDescription tensor_description(); public native TensorDescription mutable_tensor_description(); public native TensorDescription release_tensor_description(); public native void set_allocated_tensor_description(TensorDescription tensor_description); } // ------------------------------------------------------------------- @Namespace("tensorflow") @NoOffset public static class NodeExecStats extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public NodeExecStats(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public NodeExecStats(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public NodeExecStats position(long position) { return (NodeExecStats)super.position(position); } public NodeExecStats() { super((Pointer)null); allocate(); } private native void allocate(); public NodeExecStats(@Const @ByRef NodeExecStats from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef NodeExecStats from); public native @ByRef @Name("operator =") NodeExecStats put(@Const @ByRef NodeExecStats from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef NodeExecStats default_instance(); public native void Swap(NodeExecStats other); // implements Message ---------------------------------------------- public native NodeExecStats New(); public native NodeExecStats New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef NodeExecStats from); public native void MergeFrom(@Const @ByRef NodeExecStats from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // optional string node_name = 1; public native void clear_node_name(); @MemberGetter public static native int kNodeNameFieldNumber(); public static final int kNodeNameFieldNumber = kNodeNameFieldNumber(); public native @StdString BytePointer node_name(); public native void set_node_name(@StdString BytePointer value); public native void set_node_name(@StdString String value); public native void set_node_name(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_node_name(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_node_name(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_node_name(); public native void set_allocated_node_name(@StdString @Cast({"char*", "std::string*"}) BytePointer node_name); // optional int64 all_start_micros = 2; public native void clear_all_start_micros(); @MemberGetter public static native int kAllStartMicrosFieldNumber(); public static final int kAllStartMicrosFieldNumber = kAllStartMicrosFieldNumber(); public native @Cast("google::protobuf::int64") long all_start_micros(); public native void set_all_start_micros(@Cast("google::protobuf::int64") long value); // optional int64 op_start_rel_micros = 3; public native void clear_op_start_rel_micros(); @MemberGetter public static native int kOpStartRelMicrosFieldNumber(); public static final int kOpStartRelMicrosFieldNumber = kOpStartRelMicrosFieldNumber(); public native @Cast("google::protobuf::int64") long op_start_rel_micros(); public native void set_op_start_rel_micros(@Cast("google::protobuf::int64") long value); // optional int64 op_end_rel_micros = 4; public native void clear_op_end_rel_micros(); @MemberGetter public static native int kOpEndRelMicrosFieldNumber(); public static final int kOpEndRelMicrosFieldNumber = kOpEndRelMicrosFieldNumber(); public native @Cast("google::protobuf::int64") long op_end_rel_micros(); public native void set_op_end_rel_micros(@Cast("google::protobuf::int64") long value); // optional int64 all_end_rel_micros = 5; public native void clear_all_end_rel_micros(); @MemberGetter public static native int kAllEndRelMicrosFieldNumber(); public static final int kAllEndRelMicrosFieldNumber = kAllEndRelMicrosFieldNumber(); public native @Cast("google::protobuf::int64") long all_end_rel_micros(); public native void set_all_end_rel_micros(@Cast("google::protobuf::int64") long value); // repeated .tensorflow.AllocatorMemoryUsed memory = 6; public native int memory_size(); public native void clear_memory(); @MemberGetter public static native int kMemoryFieldNumber(); public static final int kMemoryFieldNumber = kMemoryFieldNumber(); public native @Const @ByRef AllocatorMemoryUsed memory(int index); public native AllocatorMemoryUsed mutable_memory(int index); public native AllocatorMemoryUsed add_memory(); // repeated .tensorflow.NodeOutput output = 7; public native int output_size(); public native void clear_output(); @MemberGetter public static native int kOutputFieldNumber(); public static final int kOutputFieldNumber = kOutputFieldNumber(); public native @Const @ByRef NodeOutput output(int index); public native NodeOutput mutable_output(int index); public native NodeOutput add_output(); // optional string timeline_label = 8; public native void clear_timeline_label(); @MemberGetter public static native int kTimelineLabelFieldNumber(); public static final int kTimelineLabelFieldNumber = kTimelineLabelFieldNumber(); public native @StdString BytePointer timeline_label(); public native void set_timeline_label(@StdString BytePointer value); public native void set_timeline_label(@StdString String value); public native void set_timeline_label(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_timeline_label(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_timeline_label(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_timeline_label(); public native void set_allocated_timeline_label(@StdString @Cast({"char*", "std::string*"}) BytePointer timeline_label); // optional int64 scheduled_micros = 9; public native void clear_scheduled_micros(); @MemberGetter public static native int kScheduledMicrosFieldNumber(); public static final int kScheduledMicrosFieldNumber = kScheduledMicrosFieldNumber(); public native @Cast("google::protobuf::int64") long scheduled_micros(); public native void set_scheduled_micros(@Cast("google::protobuf::int64") long value); // optional uint32 thread_id = 10; public native void clear_thread_id(); @MemberGetter public static native int kThreadIdFieldNumber(); public static final int kThreadIdFieldNumber = kThreadIdFieldNumber(); public native @Cast("google::protobuf::uint32") int thread_id(); public native void set_thread_id(@Cast("google::protobuf::uint32") int value); // repeated .tensorflow.AllocationDescription referenced_tensor = 11; public native int referenced_tensor_size(); public native void clear_referenced_tensor(); @MemberGetter public static native int kReferencedTensorFieldNumber(); public static final int kReferencedTensorFieldNumber = kReferencedTensorFieldNumber(); public native @Const @ByRef AllocationDescription referenced_tensor(int index); public native AllocationDescription mutable_referenced_tensor(int index); public native AllocationDescription add_referenced_tensor(); } // ------------------------------------------------------------------- @Namespace("tensorflow") @NoOffset public static class DeviceStepStats extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public DeviceStepStats(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public DeviceStepStats(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public DeviceStepStats position(long position) { return (DeviceStepStats)super.position(position); } public DeviceStepStats() { super((Pointer)null); allocate(); } private native void allocate(); public DeviceStepStats(@Const @ByRef DeviceStepStats from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef DeviceStepStats from); public native @ByRef @Name("operator =") DeviceStepStats put(@Const @ByRef DeviceStepStats from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef DeviceStepStats default_instance(); public native void Swap(DeviceStepStats other); // implements Message ---------------------------------------------- public native DeviceStepStats New(); public native DeviceStepStats New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef DeviceStepStats from); public native void MergeFrom(@Const @ByRef DeviceStepStats from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // optional string device = 1; public native void clear_device(); @MemberGetter public static native int kDeviceFieldNumber(); public static final int kDeviceFieldNumber = kDeviceFieldNumber(); public native @StdString BytePointer device(); public native void set_device(@StdString BytePointer value); public native void set_device(@StdString String value); public native void set_device(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_device(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_device(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_device(); public native void set_allocated_device(@StdString @Cast({"char*", "std::string*"}) BytePointer device); // repeated .tensorflow.NodeExecStats node_stats = 2; public native int node_stats_size(); public native void clear_node_stats(); @MemberGetter public static native int kNodeStatsFieldNumber(); public static final int kNodeStatsFieldNumber = kNodeStatsFieldNumber(); public native @Const @ByRef NodeExecStats node_stats(int index); public native NodeExecStats mutable_node_stats(int index); public native NodeExecStats add_node_stats(); } // ------------------------------------------------------------------- @Namespace("tensorflow") @NoOffset public static class StepStats extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public StepStats(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public StepStats(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public StepStats position(long position) { return (StepStats)super.position(position); } public StepStats() { super((Pointer)null); allocate(); } private native void allocate(); public StepStats(@Const @ByRef StepStats from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef StepStats from); public native @ByRef @Name("operator =") StepStats put(@Const @ByRef StepStats from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef StepStats default_instance(); public native void Swap(StepStats other); // implements Message ---------------------------------------------- public native StepStats New(); public native StepStats New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef StepStats from); public native void MergeFrom(@Const @ByRef StepStats from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // repeated .tensorflow.DeviceStepStats dev_stats = 1; public native int dev_stats_size(); public native void clear_dev_stats(); @MemberGetter public static native int kDevStatsFieldNumber(); public static final int kDevStatsFieldNumber = kDevStatsFieldNumber(); public native @Const @ByRef DeviceStepStats dev_stats(int index); public native DeviceStepStats mutable_dev_stats(int index); public native DeviceStepStats add_dev_stats(); } // =================================================================== // =================================================================== // #if !PROTOBUF_INLINE_NOT_IN_HEADERS // AllocatorMemoryUsed // optional string allocator_name = 1; // optional int64 total_bytes = 2; // optional int64 peak_bytes = 3; // ------------------------------------------------------------------- // NodeOutput // optional int32 slot = 1; // optional .tensorflow.TensorDescription tensor_description = 3; // ------------------------------------------------------------------- // NodeExecStats // optional string node_name = 1; // optional int64 all_start_micros = 2; // optional int64 op_start_rel_micros = 3; // optional int64 op_end_rel_micros = 4; // optional int64 all_end_rel_micros = 5; // repeated .tensorflow.AllocatorMemoryUsed memory = 6; // repeated .tensorflow.NodeOutput output = 7; // optional string timeline_label = 8; // optional int64 scheduled_micros = 9; // optional uint32 thread_id = 10; // repeated .tensorflow.AllocationDescription referenced_tensor = 11; // ------------------------------------------------------------------- // DeviceStepStats // optional string device = 1; // repeated .tensorflow.NodeExecStats node_stats = 2; // ------------------------------------------------------------------- // StepStats // repeated .tensorflow.DeviceStepStats dev_stats = 1; // #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // @@protoc_insertion_point(namespace_scope) // namespace tensorflow // @@protoc_insertion_point(global_scope) // #endif // PROTOBUF_tensorflow_2fcore_2fframework_2fstep_5fstats_2eproto__INCLUDED // Parsed from tensorflow/core/framework/versions.pb.h // Generated by the protocol buffer compiler. DO NOT EDIT! // source: tensorflow/core/framework/versions.proto // #ifndef PROTOBUF_tensorflow_2fcore_2fframework_2fversions_2eproto__INCLUDED // #define PROTOBUF_tensorflow_2fcore_2fframework_2fversions_2eproto__INCLUDED // #include // #include // #if GOOGLE_PROTOBUF_VERSION < 3000000 // #error This file was generated by a newer version of protoc which is // #error incompatible with your Protocol Buffer headers. Please update // #error your headers. // #endif // #if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION // #error This file was generated by an older version of protoc which is // #error incompatible with your Protocol Buffer headers. Please // #error regenerate this file with a newer version of protoc. // #endif // #include // #include // #include // #include // #include // #include // #include // #include // @@protoc_insertion_point(includes) // Internal implementation detail -- do not call these. @Namespace("tensorflow") public static native void protobuf_AddDesc_tensorflow_2fcore_2fframework_2fversions_2eproto(); @Namespace("tensorflow") public static native void protobuf_AssignDesc_tensorflow_2fcore_2fframework_2fversions_2eproto(); @Namespace("tensorflow") public static native void protobuf_ShutdownFile_tensorflow_2fcore_2fframework_2fversions_2eproto(); // =================================================================== @Namespace("tensorflow") @NoOffset public static class VersionDef extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public VersionDef(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public VersionDef(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public VersionDef position(long position) { return (VersionDef)super.position(position); } public VersionDef() { super((Pointer)null); allocate(); } private native void allocate(); public VersionDef(@Const @ByRef VersionDef from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef VersionDef from); public native @ByRef @Name("operator =") VersionDef put(@Const @ByRef VersionDef from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef VersionDef default_instance(); public native void Swap(VersionDef other); // implements Message ---------------------------------------------- public native VersionDef New(); public native VersionDef New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef VersionDef from); public native void MergeFrom(@Const @ByRef VersionDef from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // optional int32 producer = 1; public native void clear_producer(); @MemberGetter public static native int kProducerFieldNumber(); public static final int kProducerFieldNumber = kProducerFieldNumber(); public native @Cast("google::protobuf::int32") int producer(); public native void set_producer(@Cast("google::protobuf::int32") int value); // optional int32 min_consumer = 2; public native void clear_min_consumer(); @MemberGetter public static native int kMinConsumerFieldNumber(); public static final int kMinConsumerFieldNumber = kMinConsumerFieldNumber(); public native @Cast("google::protobuf::int32") int min_consumer(); public native void set_min_consumer(@Cast("google::protobuf::int32") int value); // repeated int32 bad_consumers = 3; public native int bad_consumers_size(); public native void clear_bad_consumers(); @MemberGetter public static native int kBadConsumersFieldNumber(); public static final int kBadConsumersFieldNumber = kBadConsumersFieldNumber(); public native @Cast("google::protobuf::int32") int bad_consumers(int index); public native void set_bad_consumers(int index, @Cast("google::protobuf::int32") int value); public native void add_bad_consumers(@Cast("google::protobuf::int32") int value); } // =================================================================== // =================================================================== // #if !PROTOBUF_INLINE_NOT_IN_HEADERS // VersionDef // optional int32 producer = 1; // optional int32 min_consumer = 2; // repeated int32 bad_consumers = 3; // #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) // namespace tensorflow // @@protoc_insertion_point(global_scope) // #endif // PROTOBUF_tensorflow_2fcore_2fframework_2fversions_2eproto__INCLUDED // Parsed from tensorflow/core/public/session_options.h /* Copyright 2015 Google Inc. 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_PUBLIC_SESSION_OPTIONS_H_ // #define TENSORFLOW_PUBLIC_SESSION_OPTIONS_H_ // #include // #include "tensorflow/core/platform/types.h" // #include "tensorflow/core/protobuf/config.pb.h" /** Configuration information for a Session. */ @Namespace("tensorflow") @NoOffset public static class SessionOptions extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public SessionOptions(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public SessionOptions(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public SessionOptions position(long position) { return (SessionOptions)super.position(position); } /** The environment to use. */ /// /// /// /// /// public native Env env(); public native SessionOptions env(Env env); /** \brief The TensorFlow runtime to connect to. * * If 'target' is empty or unspecified, the local TensorFlow runtime * implementation will be used. Otherwise, the TensorFlow engine * defined by 'target' will be used to perform all computations. * * "target" can be either a single entry or a comma separated list * of entries. Each entry is a resolvable address of the * following format: * local * ip:port * host:port * ... other system-specific formats to identify tasks and jobs ... * * NOTE: at the moment 'local' maps to an in-process service-based * runtime. * * Upon creation, a single session affines itself to one of the * remote processes, with possible load balancing choices when the * "target" resolves to a list of possible processes. * * If the session disconnects from the remote process during its * lifetime, session calls may fail immediately. */ public native @StdString BytePointer target(); public native SessionOptions target(BytePointer target); /** Configuration options. */ public native @ByRef ConfigProto config(); public native SessionOptions config(ConfigProto config); public SessionOptions() { super((Pointer)null); allocate(); } private native void allocate(); } // end namespace tensorflow // #endif // TENSORFLOW_PUBLIC_SESSION_OPTIONS_H_ // Parsed from tensorflow/core/lib/core/threadpool.h /* Copyright 2015 Google Inc. 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_LIB_CORE_THREADPOOL_H_ // #define TENSORFLOW_LIB_CORE_THREADPOOL_H_ // #include // #include // #include "tensorflow/core/platform/env.h" // #include "tensorflow/core/platform/macros.h" // #include "tensorflow/core/platform/types.h" @Namespace("tensorflow::thread") @NoOffset public static class ThreadPool extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public ThreadPool(Pointer p) { super(p); } // Construct a pool that contains "num_threads" threads with specified "name". // env->StartThread() is used to create individual threads. // // REQUIRES: num_threads > 0 public ThreadPool(Env env, @StdString BytePointer name, int num_threads) { super((Pointer)null); allocate(env, name, num_threads); } private native void allocate(Env env, @StdString BytePointer name, int num_threads); public ThreadPool(Env env, @StdString String name, int num_threads) { super((Pointer)null); allocate(env, name, num_threads); } private native void allocate(Env env, @StdString String name, int num_threads); // Construct a pool that contains "num_threads" threads with specified "name". // env->StartThread() is used to create individual threads. // // REQUIRES: num_threads > 0 public ThreadPool(Env env, @Const @ByRef ThreadOptions thread_options, @StdString BytePointer name, int num_threads) { super((Pointer)null); allocate(env, thread_options, name, num_threads); } private native void allocate(Env env, @Const @ByRef ThreadOptions thread_options, @StdString BytePointer name, int num_threads); public ThreadPool(Env env, @Const @ByRef ThreadOptions thread_options, @StdString String name, int num_threads) { super((Pointer)null); allocate(env, thread_options, name, num_threads); } private native void allocate(Env env, @Const @ByRef ThreadOptions thread_options, @StdString String name, int num_threads); // Wait until all scheduled work has finished and then destroy the // set of threads. // Schedule fn() for execution in the pool of threads. public native void Schedule(@ByVal Fn fn); @Opaque public static class Impl extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public Impl() { super((Pointer)null); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public Impl(Pointer p) { super(p); } } } // namespace thread // namespace tensorflow // #endif // TENSORFLOW_LIB_CORE_THREADPOOL_H_ // Parsed from tensorflow/core/framework/allocation_description.pb.h // Generated by the protocol buffer compiler. DO NOT EDIT! // source: tensorflow/core/framework/allocation_description.proto // #ifndef PROTOBUF_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto__INCLUDED // #define PROTOBUF_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto__INCLUDED // #include // #include // #if GOOGLE_PROTOBUF_VERSION < 3000000 // #error This file was generated by a newer version of protoc which is // #error incompatible with your Protocol Buffer headers. Please update // #error your headers. // #endif // #if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION // #error This file was generated by an older version of protoc which is // #error incompatible with your Protocol Buffer headers. Please // #error regenerate this file with a newer version of protoc. // #endif // #include // #include // #include // #include // #include // #include // #include // #include // @@protoc_insertion_point(includes) // Internal implementation detail -- do not call these. @Namespace("tensorflow") public static native void protobuf_AddDesc_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto(); @Namespace("tensorflow") public static native void protobuf_AssignDesc_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto(); @Namespace("tensorflow") public static native void protobuf_ShutdownFile_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto(); // =================================================================== @Namespace("tensorflow") @NoOffset public static class AllocationDescription extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public AllocationDescription(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public AllocationDescription(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public AllocationDescription position(long position) { return (AllocationDescription)super.position(position); } public AllocationDescription() { super((Pointer)null); allocate(); } private native void allocate(); public AllocationDescription(@Const @ByRef AllocationDescription from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef AllocationDescription from); public native @ByRef @Name("operator =") AllocationDescription put(@Const @ByRef AllocationDescription from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef AllocationDescription default_instance(); public native void Swap(AllocationDescription other); // implements Message ---------------------------------------------- public native AllocationDescription New(); public native AllocationDescription New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef AllocationDescription from); public native void MergeFrom(@Const @ByRef AllocationDescription from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // optional int64 requested_bytes = 1; public native void clear_requested_bytes(); @MemberGetter public static native int kRequestedBytesFieldNumber(); public static final int kRequestedBytesFieldNumber = kRequestedBytesFieldNumber(); public native @Cast("google::protobuf::int64") long requested_bytes(); public native void set_requested_bytes(@Cast("google::protobuf::int64") long value); // optional int64 allocated_bytes = 2; public native void clear_allocated_bytes(); @MemberGetter public static native int kAllocatedBytesFieldNumber(); public static final int kAllocatedBytesFieldNumber = kAllocatedBytesFieldNumber(); public native @Cast("google::protobuf::int64") long allocated_bytes(); public native void set_allocated_bytes(@Cast("google::protobuf::int64") long value); // optional string allocator_name = 3; public native void clear_allocator_name(); @MemberGetter public static native int kAllocatorNameFieldNumber(); public static final int kAllocatorNameFieldNumber = kAllocatorNameFieldNumber(); public native @StdString BytePointer allocator_name(); public native void set_allocator_name(@StdString BytePointer value); public native void set_allocator_name(@StdString String value); public native void set_allocator_name(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_allocator_name(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_allocator_name(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_allocator_name(); public native void set_allocated_allocator_name(@StdString @Cast({"char*", "std::string*"}) BytePointer allocator_name); // optional int64 allocation_id = 4; public native void clear_allocation_id(); @MemberGetter public static native int kAllocationIdFieldNumber(); public static final int kAllocationIdFieldNumber = kAllocationIdFieldNumber(); public native @Cast("google::protobuf::int64") long allocation_id(); public native void set_allocation_id(@Cast("google::protobuf::int64") long value); // optional bool has_single_reference = 5; public native void clear_has_single_reference(); @MemberGetter public static native int kHasSingleReferenceFieldNumber(); public static final int kHasSingleReferenceFieldNumber = kHasSingleReferenceFieldNumber(); public native @Cast("bool") boolean has_single_reference(); public native void set_has_single_reference(@Cast("bool") boolean value); // optional uint64 ptr = 6; public native void clear_ptr(); @MemberGetter public static native int kPtrFieldNumber(); public static final int kPtrFieldNumber = kPtrFieldNumber(); public native @Cast("google::protobuf::uint64") long ptr(); public native void set_ptr(@Cast("google::protobuf::uint64") long value); } // =================================================================== // =================================================================== // #if !PROTOBUF_INLINE_NOT_IN_HEADERS // AllocationDescription // optional int64 requested_bytes = 1; // optional int64 allocated_bytes = 2; // optional string allocator_name = 3; // optional int64 allocation_id = 4; // optional bool has_single_reference = 5; // optional uint64 ptr = 6; // #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) // namespace tensorflow // @@protoc_insertion_point(global_scope) // #endif // PROTOBUF_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto__INCLUDED // Parsed from tensorflow/core/framework/allocator.h /* Copyright 2015 Google Inc. 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_FRAMEWORK_ALLOCATOR_H_ // #define TENSORFLOW_FRAMEWORK_ALLOCATOR_H_ // #include // #include // #include // #include "tensorflow/core/framework/numeric_types.h" // #include "tensorflow/core/framework/type_traits.h" // #include "tensorflow/core/platform/logging.h" // #include "tensorflow/core/platform/types.h" // Attributes for a single allocation call. Different calls to the same // allocator could potentially have different allocation attributes. @Namespace("tensorflow") public static class AllocationAttributes extends Pointer { static { Loader.load(); } /** Default native constructor. */ public AllocationAttributes() { super((Pointer)null); allocate(); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public AllocationAttributes(long size) { super((Pointer)null); allocateArray(size); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public AllocationAttributes(Pointer p) { super(p); } private native void allocate(); private native void allocateArray(long size); @Override public AllocationAttributes position(long position) { return (AllocationAttributes)super.position(position); } // If the first attempt to allocate the memory fails, the allocation // should return immediately without retrying. // An example use case is optional scratch spaces where a failure // has only performance impact. public native @Cast("bool") boolean no_retry_on_failure(); public native AllocationAttributes no_retry_on_failure(boolean no_retry_on_failure); // If a Tensor is allocated without the following set to true, then // it is logged as an unknown allocation. During execution Tensors // should be allocated through the OpKernelContext which records // which Op is performing the allocation, and sets this flag to // true. public native @Cast("bool") boolean allocation_will_be_logged(); public native AllocationAttributes allocation_will_be_logged(boolean allocation_will_be_logged); } // Runtime statistics collected by an allocator. @Namespace("tensorflow") @NoOffset public static class AllocatorStats extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public AllocatorStats(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public AllocatorStats(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public AllocatorStats position(long position) { return (AllocatorStats)super.position(position); } public native @Cast("tensorflow::int64") long num_allocs(); public native AllocatorStats num_allocs(long num_allocs); // Number of allocations. public native @Cast("tensorflow::int64") long bytes_in_use(); public native AllocatorStats bytes_in_use(long bytes_in_use); // Number of bytes in use. public native @Cast("tensorflow::int64") long max_bytes_in_use(); public native AllocatorStats max_bytes_in_use(long max_bytes_in_use); // The maximum bytes in use. public native @Cast("tensorflow::int64") long max_alloc_size(); public native AllocatorStats max_alloc_size(long max_alloc_size); // The max single allocation seen. // The upper limit what the allocator can allocate, if such a limit // is known. Certain allocator may return 0 to indicate the limit is // unknown. public native @Cast("tensorflow::int64") long bytes_limit(); public native AllocatorStats bytes_limit(long bytes_limit); public AllocatorStats() { super((Pointer)null); allocate(); } private native void allocate(); public native void Clear(); public native @StdString BytePointer DebugString(); } // Allocator is an abstract interface for allocating and deallocating // device memory. @Namespace("tensorflow") public static class Allocator extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public Allocator(Pointer p) { super(p); } // Return a string identifying this allocator public native @StdString BytePointer Name(); // Return an uninitialized block of memory that is "num_bytes" bytes // in size. The returned pointer is guaranteed to be aligned to a // multiple of "alignment" bytes. // REQUIRES: "alignment" is a power of 2. public native Pointer AllocateRaw(@Cast("size_t") long alignment, @Cast("size_t") long num_bytes); // Return an uninitialized block of memory that is "num_bytes" bytes // in size with specified allocation attributes. The returned pointer is // guaranteed to be aligned to a multiple of "alignment" bytes. // REQUIRES: "alignment" is a power of 2. public native Pointer AllocateRaw(@Cast("size_t") long alignment, @Cast("size_t") long num_bytes, @Const @ByRef AllocationAttributes allocation_attr); // Deallocate a block of memory pointer to by "ptr" // REQUIRES: "ptr" was previously returned by a call to AllocateRaw public native void DeallocateRaw(Pointer ptr); // Convenience functions to do typed allocation. C++ constructors // and destructors are invoked for complex types if necessary, // depending on the concrete Allocator implementation. May return // NULL if the tensor has too many elements to represent in a single // allocation. // Returns true if this allocator tracks the sizes of allocations. // RequestedSize and AllocatedSize must be overridden if // TracksAllocationSizes is overridden to return true. public native @Cast("bool") boolean TracksAllocationSizes(); // Returns true if this allocator requires tensors with 0 elements // to allocate buffers. This is false for most allocators, but may // be used by special-case allocators that want to track tensor // usage. public native @Cast("bool") boolean ShouldAllocateEmptyTensors(); // Returns the user-requested size of the data allocated at // 'ptr'. Note that the actual buffer allocated might be larger // than requested, but this function returns the size requested by // the user. // // REQUIRES: TracksAllocationSizes() is true. // // REQUIRES: 'ptr!=nullptr' and points to a buffer previously // allocated by this allocator. public native @Cast("size_t") long RequestedSize(Pointer ptr); // Returns the allocated size of the buffer at 'ptr' if known, // otherwise returns RequestedSize(ptr). AllocatedSize(ptr) is // guaranteed to be >= RequestedSize(ptr). // // REQUIRES: TracksAllocationSizes() is true. // // REQUIRES: 'ptr!=nullptr' and points to a buffer previously // allocated by this allocator. public native @Cast("size_t") long AllocatedSize(Pointer ptr); // Returns either 0 or an identifier assigned to the buffer at 'ptr' // when the buffer was returned by AllocateRaw. If non-zero, the // identifier differs from every other ID assigned by this // allocator. // // REQUIRES: TracksAllocationSizes() is true. // // REQUIRES: 'ptr!=nullptr' and points to a buffer previously // allocated by this allocator. public native @Cast("tensorflow::int64") long AllocationId(Pointer ptr); // Returns the allocated size of the buffer at 'ptr' if known, // otherwise returns 0. This method can be called when // TracksAllocationSizes() is false, but can be extremely slow. // // REQUIRES: 'ptr!=nullptr' and points to a buffer previously // allocated by this allocator. public native @Cast("size_t") long AllocatedSizeSlow(Pointer ptr); // is_simple::value if T[] can be safely constructed and destructed // without running T() and ~T(). We do not use std::is_trivial // directly because std::complex and std::complex are // not trival, but their arrays can be constructed and destructed // without running their default ctors and dtors. // Fills in 'stats' with statistics collected by this allocator. public native void GetStats(AllocatorStats stats); } // Allocator-specific constructors and destructors are used for // strings // A tensorflow Op may need access to different kinds of memory that // are not simply a function of the device to which the Op has been // assigned. For example, an Op executing on a GPU may still need // to allocate CPU RAM for some purpose. Internal to the tensorflow // runtime we may choose to allocate CPU ram from special regions // that have been prepared for higher performance in some use // contexts, e.g. doing DMA with particular devices. For these // reasons, the Device interface does not expose just one memory // Allocator, but instead provides an accessor that takes a // specification of the desired memory attributes in order to select // an Allocator. // // Example use: // // Allocator for ordinary device memory: // Allocator* a = allocator(AllocatorAttributes()); // ... // // Allocator for CPU RAM, regardless of where Op is executing: // AllocatorAttributes attr; // attr.set_on_host(true); // Allocator* a = allocator(attr); @Namespace("tensorflow") public static class AllocatorAttributes extends Pointer { static { Loader.load(); } /** Default native constructor. */ public AllocatorAttributes() { super((Pointer)null); allocate(); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public AllocatorAttributes(long size) { super((Pointer)null); allocateArray(size); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public AllocatorAttributes(Pointer p) { super(p); } private native void allocate(); private native void allocateArray(long size); @Override public AllocatorAttributes position(long position) { return (AllocatorAttributes)super.position(position); } public native void set_on_host(@Cast("bool") boolean v); public native @Cast("bool") boolean on_host(); public native void set_nic_compatible(@Cast("bool") boolean v); public native @Cast("bool") boolean nic_compatible(); public native void set_gpu_compatible(@Cast("bool") boolean v); public native @Cast("bool") boolean gpu_compatible(); public native void set_track_sizes(@Cast("bool") boolean v); public native @Cast("bool") boolean track_sizes(); public native void Merge(@ByVal AllocatorAttributes other); // NOTE: The upper 8 bits of the value are reserved for // device-specific uses. Implementors of a device can interpret these // upper 8 bits in device-specific ways, and ops implemented for those // devices are responsible for setting those 8 bits appropriately. public native int value(); public native AllocatorAttributes value(int value); } // Returns a trivial implementation of Allocator which uses the system // default malloc. The returned allocator is a process singleton. @Namespace("tensorflow") public static native Allocator cpu_allocator(); // If 'enable' is true, the process-wide cpu allocator collects // AllocatorStats. By default, it's disabled. @Namespace("tensorflow") public static native void EnableCPUAllocatorStats(@Cast("bool") boolean enable); // If 'enable' is true, the process-wide cpu allocator collects // detailed statistics. This can be slow, so this is disabled by // default. @Namespace("tensorflow") public static native void EnableCPUAllocatorDetailedStats(@Cast("bool") boolean enable); // Abstract interface of an object that does the underlying suballoc/free of // memory for a higher-level allocator. @Namespace("tensorflow") public static class SubAllocator extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public SubAllocator(Pointer p) { super(p); } public native Pointer Alloc(@Cast("size_t") long alignment, @Cast("size_t") long num_bytes); public native void Free(Pointer ptr, @Cast("size_t") long num_bytes); } // namespace tensorflow // #endif // TENSORFLOW_FRAMEWORK_ALLOCATOR_H_ // Parsed from tensorflow/core/framework/tensor_shape.pb.h // Generated by the protocol buffer compiler. DO NOT EDIT! // source: tensorflow/core/framework/tensor_shape.proto // #ifndef PROTOBUF_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto__INCLUDED // #define PROTOBUF_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto__INCLUDED // #include // #include // #if GOOGLE_PROTOBUF_VERSION < 3000000 // #error This file was generated by a newer version of protoc which is // #error incompatible with your Protocol Buffer headers. Please update // #error your headers. // #endif // #if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION // #error This file was generated by an older version of protoc which is // #error incompatible with your Protocol Buffer headers. Please // #error regenerate this file with a newer version of protoc. // #endif // #include // #include // #include // #include // #include // #include // #include // #include // @@protoc_insertion_point(includes) // Internal implementation detail -- do not call these. @Namespace("tensorflow") public static native void protobuf_AddDesc_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto(); @Namespace("tensorflow") public static native void protobuf_AssignDesc_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto(); @Namespace("tensorflow") public static native void protobuf_ShutdownFile_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto(); // =================================================================== @Namespace("tensorflow") @NoOffset public static class TensorShapeProto_Dim extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public TensorShapeProto_Dim(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public TensorShapeProto_Dim(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public TensorShapeProto_Dim position(long position) { return (TensorShapeProto_Dim)super.position(position); } public TensorShapeProto_Dim() { super((Pointer)null); allocate(); } private native void allocate(); public TensorShapeProto_Dim(@Const @ByRef TensorShapeProto_Dim from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef TensorShapeProto_Dim from); public native @ByRef @Name("operator =") TensorShapeProto_Dim put(@Const @ByRef TensorShapeProto_Dim from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef TensorShapeProto_Dim default_instance(); public native void Swap(TensorShapeProto_Dim other); // implements Message ---------------------------------------------- public native TensorShapeProto_Dim New(); public native TensorShapeProto_Dim New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef TensorShapeProto_Dim from); public native void MergeFrom(@Const @ByRef TensorShapeProto_Dim from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // optional int64 size = 1; public native void clear_size(); @MemberGetter public static native int kSizeFieldNumber(); public static final int kSizeFieldNumber = kSizeFieldNumber(); public native @Cast("google::protobuf::int64") long size(); public native void set_size(@Cast("google::protobuf::int64") long value); // optional string name = 2; public native void clear_name(); @MemberGetter public static native int kNameFieldNumber(); public static final int kNameFieldNumber = kNameFieldNumber(); public native @StdString BytePointer name(); public native void set_name(@StdString BytePointer value); public native void set_name(@StdString String value); public native void set_name(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_name(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_name(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_name(); public native void set_allocated_name(@StdString @Cast({"char*", "std::string*"}) BytePointer name); } // ------------------------------------------------------------------- @Namespace("tensorflow") @NoOffset public static class TensorShapeProto extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public TensorShapeProto(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public TensorShapeProto(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public TensorShapeProto position(long position) { return (TensorShapeProto)super.position(position); } public TensorShapeProto() { super((Pointer)null); allocate(); } private native void allocate(); public TensorShapeProto(@Const @ByRef TensorShapeProto from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef TensorShapeProto from); public native @ByRef @Name("operator =") TensorShapeProto put(@Const @ByRef TensorShapeProto from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef TensorShapeProto default_instance(); public native void Swap(TensorShapeProto other); // implements Message ---------------------------------------------- public native TensorShapeProto New(); public native TensorShapeProto New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef TensorShapeProto from); public native void MergeFrom(@Const @ByRef TensorShapeProto from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // repeated .tensorflow.TensorShapeProto.Dim dim = 2; public native int dim_size(); public native void clear_dim(); @MemberGetter public static native int kDimFieldNumber(); public static final int kDimFieldNumber = kDimFieldNumber(); public native @Const @ByRef TensorShapeProto_Dim dim(int index); public native TensorShapeProto_Dim mutable_dim(int index); public native TensorShapeProto_Dim add_dim(); // optional bool unknown_rank = 3; public native void clear_unknown_rank(); @MemberGetter public static native int kUnknownRankFieldNumber(); public static final int kUnknownRankFieldNumber = kUnknownRankFieldNumber(); public native @Cast("bool") boolean unknown_rank(); public native void set_unknown_rank(@Cast("bool") boolean value); } // =================================================================== // =================================================================== // #if !PROTOBUF_INLINE_NOT_IN_HEADERS // TensorShapeProto_Dim // optional int64 size = 1; // optional string name = 2; // ------------------------------------------------------------------- // TensorShapeProto // repeated .tensorflow.TensorShapeProto.Dim dim = 2; // optional bool unknown_rank = 3; // #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // ------------------------------------------------------------------- // @@protoc_insertion_point(namespace_scope) // namespace tensorflow // @@protoc_insertion_point(global_scope) // #endif // PROTOBUF_tensorflow_2fcore_2fframework_2ftensor_5fshape_2eproto__INCLUDED // Parsed from tensorflow/core/framework/types.pb.h // Generated by the protocol buffer compiler. DO NOT EDIT! // source: tensorflow/core/framework/types.proto // #ifndef PROTOBUF_tensorflow_2fcore_2fframework_2ftypes_2eproto__INCLUDED // #define PROTOBUF_tensorflow_2fcore_2fframework_2ftypes_2eproto__INCLUDED // #include // #include // #if GOOGLE_PROTOBUF_VERSION < 3000000 // #error This file was generated by a newer version of protoc which is // #error incompatible with your Protocol Buffer headers. Please update // #error your headers. // #endif // #if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION // #error This file was generated by an older version of protoc which is // #error incompatible with your Protocol Buffer headers. Please // #error regenerate this file with a newer version of protoc. // #endif // #include // #include // #include // #include // #include // #include // #include // @@protoc_insertion_point(includes) // Internal implementation detail -- do not call these. @Namespace("tensorflow") public static native void protobuf_AddDesc_tensorflow_2fcore_2fframework_2ftypes_2eproto(); @Namespace("tensorflow") public static native void protobuf_AssignDesc_tensorflow_2fcore_2fframework_2ftypes_2eproto(); @Namespace("tensorflow") public static native void protobuf_ShutdownFile_tensorflow_2fcore_2fframework_2ftypes_2eproto(); /** enum tensorflow::DataType */ public static final int DT_INVALID = 0, DT_FLOAT = 1, DT_DOUBLE = 2, DT_INT32 = 3, DT_UINT8 = 4, DT_INT16 = 5, DT_INT8 = 6, DT_STRING = 7, DT_COMPLEX64 = 8, DT_INT64 = 9, DT_BOOL = 10, DT_QINT8 = 11, DT_QUINT8 = 12, DT_QINT32 = 13, DT_BFLOAT16 = 14, DT_QINT16 = 15, DT_QUINT16 = 16, DT_UINT16 = 17, DT_COMPLEX128 = 18, DT_HALF = 19, DT_FLOAT_REF = 101, DT_DOUBLE_REF = 102, DT_INT32_REF = 103, DT_UINT8_REF = 104, DT_INT16_REF = 105, DT_INT8_REF = 106, DT_STRING_REF = 107, DT_COMPLEX64_REF = 108, DT_INT64_REF = 109, DT_BOOL_REF = 110, DT_QINT8_REF = 111, DT_QUINT8_REF = 112, DT_QINT32_REF = 113, DT_BFLOAT16_REF = 114, DT_QINT16_REF = 115, DT_QUINT16_REF = 116, DT_UINT16_REF = 117, DT_COMPLEX128_REF = 118, DT_HALF_REF = 119, DataType_INT_MIN_SENTINEL_DO_NOT_USE_ =kint32min, DataType_INT_MAX_SENTINEL_DO_NOT_USE_ =kint32max; @Namespace("tensorflow") public static native @Cast("bool") boolean DataType_IsValid(int value); @Namespace("tensorflow") @MemberGetter public static native @Cast("const tensorflow::DataType") int DataType_MIN(); @Namespace("tensorflow") @MemberGetter public static native @Cast("const tensorflow::DataType") int DataType_MAX(); @Namespace("tensorflow") @MemberGetter public static native int DataType_ARRAYSIZE(); @Namespace("tensorflow") public static native @Cast("const google::protobuf::EnumDescriptor*") Pointer DataType_descriptor(); @Namespace("tensorflow") public static native @StdString BytePointer DataType_Name(@Cast("tensorflow::DataType") int value); @Namespace("tensorflow") public static native @Cast("bool") boolean DataType_Parse( @StdString BytePointer name, @Cast("tensorflow::DataType*") IntPointer value); @Namespace("tensorflow") public static native @Cast("bool") boolean DataType_Parse( @StdString String name, @Cast("tensorflow::DataType*") IntPointer value); // =================================================================== // =================================================================== // =================================================================== // #if !PROTOBUF_INLINE_NOT_IN_HEADERS // #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) // namespace tensorflow // #ifndef SWIG // #endif // SWIG // @@protoc_insertion_point(global_scope) // #endif // PROTOBUF_tensorflow_2fcore_2fframework_2ftypes_2eproto__INCLUDED // Parsed from tensorflow/core/framework/tensor.pb.h // Generated by the protocol buffer compiler. DO NOT EDIT! // source: tensorflow/core/framework/tensor.proto // #ifndef PROTOBUF_tensorflow_2fcore_2fframework_2ftensor_2eproto__INCLUDED // #define PROTOBUF_tensorflow_2fcore_2fframework_2ftensor_2eproto__INCLUDED // #include // #include // #if GOOGLE_PROTOBUF_VERSION < 3000000 // #error This file was generated by a newer version of protoc which is // #error incompatible with your Protocol Buffer headers. Please update // #error your headers. // #endif // #if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION // #error This file was generated by an older version of protoc which is // #error incompatible with your Protocol Buffer headers. Please // #error regenerate this file with a newer version of protoc. // #endif // #include // #include // #include // #include // #include // #include // #include // #include // #include "tensorflow/core/framework/tensor_shape.pb.h" // #include "tensorflow/core/framework/types.pb.h" // @@protoc_insertion_point(includes) // Internal implementation detail -- do not call these. @Namespace("tensorflow") public static native void protobuf_AddDesc_tensorflow_2fcore_2fframework_2ftensor_2eproto(); @Namespace("tensorflow") public static native void protobuf_AssignDesc_tensorflow_2fcore_2fframework_2ftensor_2eproto(); @Namespace("tensorflow") public static native void protobuf_ShutdownFile_tensorflow_2fcore_2fframework_2ftensor_2eproto(); // =================================================================== @Namespace("tensorflow") @NoOffset public static class TensorProto extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public TensorProto(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public TensorProto(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public TensorProto position(long position) { return (TensorProto)super.position(position); } public TensorProto() { super((Pointer)null); allocate(); } private native void allocate(); public TensorProto(@Const @ByRef TensorProto from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef TensorProto from); public native @ByRef @Name("operator =") TensorProto put(@Const @ByRef TensorProto from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef TensorProto default_instance(); public native void Swap(TensorProto other); // implements Message ---------------------------------------------- public native TensorProto New(); public native TensorProto New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef TensorProto from); public native void MergeFrom(@Const @ByRef TensorProto from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // optional .tensorflow.DataType dtype = 1; public native void clear_dtype(); @MemberGetter public static native int kDtypeFieldNumber(); public static final int kDtypeFieldNumber = kDtypeFieldNumber(); public native @Cast("tensorflow::DataType") int dtype(); public native void set_dtype(@Cast("tensorflow::DataType") int value); // optional .tensorflow.TensorShapeProto tensor_shape = 2; public native @Cast("bool") boolean has_tensor_shape(); public native void clear_tensor_shape(); @MemberGetter public static native int kTensorShapeFieldNumber(); public static final int kTensorShapeFieldNumber = kTensorShapeFieldNumber(); public native @Const @ByRef TensorShapeProto tensor_shape(); public native TensorShapeProto mutable_tensor_shape(); public native TensorShapeProto release_tensor_shape(); public native void set_allocated_tensor_shape(TensorShapeProto tensor_shape); // optional int32 version_number = 3; public native void clear_version_number(); @MemberGetter public static native int kVersionNumberFieldNumber(); public static final int kVersionNumberFieldNumber = kVersionNumberFieldNumber(); public native @Cast("google::protobuf::int32") int version_number(); public native void set_version_number(@Cast("google::protobuf::int32") int value); // optional bytes tensor_content = 4; public native void clear_tensor_content(); @MemberGetter public static native int kTensorContentFieldNumber(); public static final int kTensorContentFieldNumber = kTensorContentFieldNumber(); public native @StdString BytePointer tensor_content(); public native void set_tensor_content(@StdString BytePointer value); public native void set_tensor_content(@StdString String value); public native void set_tensor_content(@Const Pointer value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_tensor_content(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_tensor_content(); public native void set_allocated_tensor_content(@StdString @Cast({"char*", "std::string*"}) BytePointer tensor_content); // repeated int32 half_val = 13 [packed = true]; public native int half_val_size(); public native void clear_half_val(); @MemberGetter public static native int kHalfValFieldNumber(); public static final int kHalfValFieldNumber = kHalfValFieldNumber(); public native @Cast("google::protobuf::int32") int half_val(int index); public native void set_half_val(int index, @Cast("google::protobuf::int32") int value); public native void add_half_val(@Cast("google::protobuf::int32") int value); // repeated float float_val = 5 [packed = true]; public native int float_val_size(); public native void clear_float_val(); @MemberGetter public static native int kFloatValFieldNumber(); public static final int kFloatValFieldNumber = kFloatValFieldNumber(); public native float float_val(int index); public native void set_float_val(int index, float value); public native void add_float_val(float value); // repeated double double_val = 6 [packed = true]; public native int double_val_size(); public native void clear_double_val(); @MemberGetter public static native int kDoubleValFieldNumber(); public static final int kDoubleValFieldNumber = kDoubleValFieldNumber(); public native double double_val(int index); public native void set_double_val(int index, double value); public native void add_double_val(double value); // repeated int32 int_val = 7 [packed = true]; public native int int_val_size(); public native void clear_int_val(); @MemberGetter public static native int kIntValFieldNumber(); public static final int kIntValFieldNumber = kIntValFieldNumber(); public native @Cast("google::protobuf::int32") int int_val(int index); public native void set_int_val(int index, @Cast("google::protobuf::int32") int value); public native void add_int_val(@Cast("google::protobuf::int32") int value); // repeated bytes string_val = 8; public native int string_val_size(); public native void clear_string_val(); @MemberGetter public static native int kStringValFieldNumber(); public static final int kStringValFieldNumber = kStringValFieldNumber(); public native @StdString BytePointer string_val(int index); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_string_val(int index); public native void set_string_val(int index, @StdString BytePointer value); public native void set_string_val(int index, @StdString String value); public native void set_string_val(int index, @Const Pointer value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer add_string_val(); public native void add_string_val(@StdString BytePointer value); public native void add_string_val(@StdString String value); public native void add_string_val(@Const Pointer value, @Cast("size_t") long size); // repeated float scomplex_val = 9 [packed = true]; public native int scomplex_val_size(); public native void clear_scomplex_val(); @MemberGetter public static native int kScomplexValFieldNumber(); public static final int kScomplexValFieldNumber = kScomplexValFieldNumber(); public native float scomplex_val(int index); public native void set_scomplex_val(int index, float value); public native void add_scomplex_val(float value); // repeated int64 int64_val = 10 [packed = true]; public native int int64_val_size(); public native void clear_int64_val(); @MemberGetter public static native int kInt64ValFieldNumber(); public static final int kInt64ValFieldNumber = kInt64ValFieldNumber(); public native @Cast("google::protobuf::int64") long int64_val(int index); public native void set_int64_val(int index, @Cast("google::protobuf::int64") long value); public native void add_int64_val(@Cast("google::protobuf::int64") long value); // repeated bool bool_val = 11 [packed = true]; public native int bool_val_size(); public native void clear_bool_val(); @MemberGetter public static native int kBoolValFieldNumber(); public static final int kBoolValFieldNumber = kBoolValFieldNumber(); public native @Cast("bool") boolean bool_val(int index); public native void set_bool_val(int index, @Cast("bool") boolean value); public native void add_bool_val(@Cast("bool") boolean value); // repeated double dcomplex_val = 12 [packed = true]; public native int dcomplex_val_size(); public native void clear_dcomplex_val(); @MemberGetter public static native int kDcomplexValFieldNumber(); public static final int kDcomplexValFieldNumber = kDcomplexValFieldNumber(); public native double dcomplex_val(int index); public native void set_dcomplex_val(int index, double value); public native void add_dcomplex_val(double value); } // =================================================================== // =================================================================== // #if !PROTOBUF_INLINE_NOT_IN_HEADERS // TensorProto // optional .tensorflow.DataType dtype = 1; // optional .tensorflow.TensorShapeProto tensor_shape = 2; // optional int32 version_number = 3; // optional bytes tensor_content = 4; // repeated int32 half_val = 13 [packed = true]; // repeated float float_val = 5 [packed = true]; // repeated double double_val = 6 [packed = true]; // repeated int32 int_val = 7 [packed = true]; // repeated bytes string_val = 8; // repeated float scomplex_val = 9 [packed = true]; // repeated int64 int64_val = 10 [packed = true]; // repeated bool bool_val = 11 [packed = true]; // repeated double dcomplex_val = 12 [packed = true]; // #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) // namespace tensorflow // @@protoc_insertion_point(global_scope) // #endif // PROTOBUF_tensorflow_2fcore_2fframework_2ftensor_2eproto__INCLUDED // Parsed from tensorflow/core/framework/tensor_description.pb.h // Generated by the protocol buffer compiler. DO NOT EDIT! // source: tensorflow/core/framework/tensor_description.proto // #ifndef PROTOBUF_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto__INCLUDED // #define PROTOBUF_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto__INCLUDED // #include // #include // #if GOOGLE_PROTOBUF_VERSION < 3000000 // #error This file was generated by a newer version of protoc which is // #error incompatible with your Protocol Buffer headers. Please update // #error your headers. // #endif // #if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION // #error This file was generated by an older version of protoc which is // #error incompatible with your Protocol Buffer headers. Please // #error regenerate this file with a newer version of protoc. // #endif // #include // #include // #include // #include // #include // #include // #include // #include // #include "tensorflow/core/framework/types.pb.h" // #include "tensorflow/core/framework/tensor_shape.pb.h" // #include "tensorflow/core/framework/allocation_description.pb.h" // @@protoc_insertion_point(includes) // Internal implementation detail -- do not call these. @Namespace("tensorflow") public static native void protobuf_AddDesc_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto(); @Namespace("tensorflow") public static native void protobuf_AssignDesc_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto(); @Namespace("tensorflow") public static native void protobuf_ShutdownFile_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto(); // =================================================================== @Namespace("tensorflow") @NoOffset public static class TensorDescription extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public TensorDescription(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public TensorDescription(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public TensorDescription position(long position) { return (TensorDescription)super.position(position); } public TensorDescription() { super((Pointer)null); allocate(); } private native void allocate(); public TensorDescription(@Const @ByRef TensorDescription from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef TensorDescription from); public native @ByRef @Name("operator =") TensorDescription put(@Const @ByRef TensorDescription from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef TensorDescription default_instance(); public native void Swap(TensorDescription other); // implements Message ---------------------------------------------- public native TensorDescription New(); public native TensorDescription New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef TensorDescription from); public native void MergeFrom(@Const @ByRef TensorDescription from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // optional .tensorflow.DataType dtype = 1; public native void clear_dtype(); @MemberGetter public static native int kDtypeFieldNumber(); public static final int kDtypeFieldNumber = kDtypeFieldNumber(); public native @Cast("tensorflow::DataType") int dtype(); public native void set_dtype(@Cast("tensorflow::DataType") int value); // optional .tensorflow.TensorShapeProto shape = 2; public native @Cast("bool") boolean has_shape(); public native void clear_shape(); @MemberGetter public static native int kShapeFieldNumber(); public static final int kShapeFieldNumber = kShapeFieldNumber(); public native @Const @ByRef TensorShapeProto shape(); public native TensorShapeProto mutable_shape(); public native TensorShapeProto release_shape(); public native void set_allocated_shape(TensorShapeProto shape); // optional .tensorflow.AllocationDescription allocation_description = 4; public native @Cast("bool") boolean has_allocation_description(); public native void clear_allocation_description(); @MemberGetter public static native int kAllocationDescriptionFieldNumber(); public static final int kAllocationDescriptionFieldNumber = kAllocationDescriptionFieldNumber(); public native @Const @ByRef AllocationDescription allocation_description(); public native AllocationDescription mutable_allocation_description(); public native AllocationDescription release_allocation_description(); public native void set_allocated_allocation_description(AllocationDescription allocation_description); } // =================================================================== // =================================================================== // #if !PROTOBUF_INLINE_NOT_IN_HEADERS // TensorDescription // optional .tensorflow.DataType dtype = 1; // optional .tensorflow.TensorShapeProto shape = 2; // optional .tensorflow.AllocationDescription allocation_description = 4; // #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // @@protoc_insertion_point(namespace_scope) // namespace tensorflow // @@protoc_insertion_point(global_scope) // #endif // PROTOBUF_tensorflow_2fcore_2fframework_2ftensor_5fdescription_2eproto__INCLUDED // Parsed from tensorflow/core/framework/tensor_types.h /* Copyright 2015 Google Inc. 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_FRAMEWORK_TENSOR_TYPES_H_ // #define TENSORFLOW_FRAMEWORK_TENSOR_TYPES_H_ // #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" // Helper to define Tensor types given that the scalar is of type T. // namespace tensorflow // #endif // TENSORFLOW_FRAMEWORK_TENSOR_TYPES_H_ // Parsed from tensorflow/core/framework/tensor_shape.h /* Copyright 2015 Google Inc. 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_CORE_FRAMEWORK_TENSOR_SHAPE_H_ // #define TENSORFLOW_CORE_FRAMEWORK_TENSOR_SHAPE_H_ // #include // #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" // #include "tensorflow/core/framework/tensor_shape.pb.h" // #include "tensorflow/core/framework/types.pb.h" // #include "tensorflow/core/lib/core/errors.h" // #include "tensorflow/core/lib/core/status.h" // #include "tensorflow/core/lib/core/stringpiece.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // #include "tensorflow/core/lib/gtl/inlined_vector.h" // #include "tensorflow/core/lib/strings/strcat.h" // #include "tensorflow/core/platform/logging.h" // Declared below @Namespace("tensorflow") @NoOffset public static class TensorShape extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public TensorShape(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public TensorShape(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public TensorShape position(long position) { return (TensorShape)super.position(position); } /** \brief Construct a {@code TensorShape} from the provided sizes. * REQUIRES: {@code dim_sizes[i] >= 0} */ public TensorShape(@Cast("tensorflow::int64*") @ArraySlice LongPointer dim_sizes) { super((Pointer)null); allocate(dim_sizes); } private native void allocate(@Cast("tensorflow::int64*") @ArraySlice LongPointer dim_sizes); public TensorShape(@Cast("tensorflow::int64*") @ArraySlice LongBuffer dim_sizes) { super((Pointer)null); allocate(dim_sizes); } private native void allocate(@Cast("tensorflow::int64*") @ArraySlice LongBuffer dim_sizes); public TensorShape(@Cast("tensorflow::int64*") @ArraySlice long... dim_sizes) { super((Pointer)null); allocate(dim_sizes); } private native void allocate(@Cast("tensorflow::int64*") @ArraySlice long... dim_sizes); /** REQUIRES: {@code IsValid(proto)} */ public TensorShape(@Const @ByRef TensorShapeProto proto) { super((Pointer)null); allocate(proto); } private native void allocate(@Const @ByRef TensorShapeProto proto); /** Create a tensor shape with no dimensions and one element, which you can * then call {@code AddDim()} on. */ public TensorShape() { super((Pointer)null); allocate(); } private native void allocate(); /** Copy the specified shape */ public TensorShape(@Const @ByRef TensorShape b) { super((Pointer)null); allocate(b); } private native void allocate(@Const @ByRef TensorShape b); public native @Name("operator =") void put(@Const @ByRef TensorShape b); /** Returns {@code true} iff {@code proto} is a valid tensor shape. */ public static native @Cast("bool") boolean IsValid(@Const @ByRef TensorShapeProto proto); /** Returns {@code OK} iff {@code proto} is a valid tensor shape, and a descriptive error * status otherwise. */ public static native @ByVal Status IsValidShape(@Const @ByRef TensorShapeProto proto); /** Clear a tensor shape */ public native void Clear(); /** \brief Add a dimension to the end ("inner-most"). * REQUIRES: {@code size >= 0} */ public native void AddDim(@Cast("tensorflow::int64") long size); /** Appends all the dimensions from {@code shape}. */ public native void AppendShape(@Const @ByRef TensorShape shape); // Maximum number of dimensions in a tensor. public static native int MaxDimensions(); /** \brief Insert a dimension somewhere in the {@code TensorShape}. * REQUIRES: {@code 0 <= d <= dims()} * REQUIRES: {@code size >= 0} */ public native void InsertDim(int d, @Cast("tensorflow::int64") long size); /** \brief Modifies the size of the dimension {@code d} to be {@code size} * REQUIRES: {@code 0 <= d < dims()} * REQUIRES: {@code size >= 0} */ public native void set_dim(int d, @Cast("tensorflow::int64") long size); /** \brief Removes dimension {@code d} from the {@code TensorShape}. * REQUIRES: {@code 0 <= d < dims()} */ public native void RemoveDim(int d); /** Return the number of dimensions in the tensor. */ public native int dims(); /** \brief Returns the number of elements in dimension {@code d}. * REQUIRES: {@code 0 <= d < dims()} */ // TODO(touts): Rename to `dimension()` to match // `Eigen::Tensor::dimension()`? public native @Cast("tensorflow::int64") long dim_size(int d); /** Returns sizes of all dimensions. */ /// public native @ByVal LongVector dim_sizes(); /** \brief Returns the number of elements in the tensor. * * We use {@code int64} and not {@code size_t} to be compatible with {@code Eigen::Tensor} * which uses {@code ptrdiff_t}. */ public native @Cast("tensorflow::int64") long num_elements(); /** Returns true if {@code *this} and {@code b} have the same sizes. Ignores * dimension names. */ public native @Cast("bool") boolean IsSameSize(@Const @ByRef TensorShape b); public native @Cast("bool") @Name("operator ==") boolean equals(@Const @ByRef TensorShape b); public native @Cast("bool") @Name("operator !=") boolean notEquals(@Const @ByRef TensorShape b); /** Fill {@code *proto} from {@code *this}. */ public native void AsProto(TensorShapeProto proto); /** Fill {@code *dsizes} from {@code *this}. */ /** Same as {@code AsEigenDSizes()} but allows for {@code NDIMS > dims()} -- in * which case we pad the rest of the sizes with 1. */ /** For iterating through the dimensions. */ public native @ByVal TensorShapeIter begin(); public native @ByVal TensorShapeIter end(); /** For error messages. */ public native @StdString BytePointer DebugString(); /** Same as {@code TensorShape(proto).DebugString()} but doesn't crash for * invalid protos. */ public static native @StdString BytePointer DebugString(@Const @ByRef TensorShapeProto proto); public native void DumpRep(); } @Namespace("tensorflow") @NoOffset public static class TensorShapeDim extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public TensorShapeDim(Pointer p) { super(p); } public TensorShapeDim(@Cast("tensorflow::int64") long s) { super((Pointer)null); allocate(s); } private native void allocate(@Cast("tensorflow::int64") long s); public native @Cast("tensorflow::int64") long size(); public native TensorShapeDim size(long size); } @Namespace("tensorflow") @NoOffset public static class TensorShapeIter extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public TensorShapeIter(Pointer p) { super(p); } public TensorShapeIter(@Const TensorShape shape, int d) { super((Pointer)null); allocate(shape, d); } private native void allocate(@Const TensorShape shape, int d); public native @Cast("bool") @Name("operator ==") boolean equals(@Const @ByRef TensorShapeIter rhs); public native @Cast("bool") @Name("operator !=") boolean notEquals(@Const @ByRef TensorShapeIter rhs); public native @Name("operator ++") void increment(); public native @ByVal @Name("operator *") TensorShapeDim multiply(); } /** \brief Static helper routines for {@code TensorShape}. Includes a few common * predicates on a tensor shape. */ @Namespace("tensorflow") public static class TensorShapeUtils extends Pointer { static { Loader.load(); } /** Default native constructor. */ public TensorShapeUtils() { super((Pointer)null); allocate(); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public TensorShapeUtils(long size) { super((Pointer)null); allocateArray(size); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public TensorShapeUtils(Pointer p) { super(p); } private native void allocate(); private native void allocateArray(long size); @Override public TensorShapeUtils position(long position) { return (TensorShapeUtils)super.position(position); } public static native @Cast("bool") boolean IsScalar(@Const @ByRef TensorShape shape); public static native @Cast("bool") boolean IsVector(@Const @ByRef TensorShape shape); public static native @Cast("bool") boolean IsVectorOrHigher(@Const @ByRef TensorShape shape); public static native @Cast("bool") boolean IsMatrix(@Const @ByRef TensorShape shape); public static native @Cast("bool") boolean IsMatrixOrHigher(@Const @ByRef TensorShape shape); /** \brief Returns a {@code TensorShape} whose dimensions are * {@code dims[0]}, {@code dims[1]}, ..., {@code dims[n-1]}. */ public static native @ByVal Status MakeShape(@Const IntPointer dims, int n, TensorShape out); public static native @ByVal Status MakeShape(@Const IntBuffer dims, int n, TensorShape out); public static native @ByVal Status MakeShape(@Const int[] dims, int n, TensorShape out); public static native @ByVal Status MakeShape(@Cast("const tensorflow::int64*") LongPointer dims, int n, TensorShape out); public static native @ByVal Status MakeShape(@Cast("const tensorflow::int64*") LongBuffer dims, int n, TensorShape out); public static native @ByVal Status MakeShape(@Cast("const tensorflow::int64*") long[] dims, int n, TensorShape out); public static native @StdString BytePointer ShapeListString(@Const @ByRef TensorShapeVector shapes); public static native @Cast("bool") boolean StartsWith(@Const @ByRef TensorShape shape0, @Const @ByRef TensorShape shape1); } // ---------------------------------------------------------------------------- // Template method implementation details below // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // Inlining of some performance critical routines // ---------------------------------------------------------------------------- // namespace tensorflow // #endif // TENSORFLOW_CORE_FRAMEWORK_TENSOR_SHAPE_H_ // Parsed from tensorflow/core/framework/tensor.h /* Copyright 2015 Google Inc. 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_CORE_FRAMEWORK_TENSOR_H_ // #define TENSORFLOW_CORE_FRAMEWORK_TENSOR_H_ // #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" // #include "tensorflow/core/framework/allocation_description.pb.h" // #include "tensorflow/core/framework/allocator.h" // #include "tensorflow/core/framework/tensor.pb.h" // #include "tensorflow/core/framework/tensor_description.pb.h" // #include "tensorflow/core/framework/tensor_shape.h" // #include "tensorflow/core/framework/tensor_types.h" // #include "tensorflow/core/framework/types.h" // #include "tensorflow/core/framework/types.pb.h" // #include "tensorflow/core/lib/core/refcount.h" // #include "tensorflow/core/lib/core/status.h" // #include "tensorflow/core/lib/core/stringpiece.h" // #include "tensorflow/core/lib/gtl/inlined_vector.h" // #include "tensorflow/core/platform/logging.h" // #include "tensorflow/core/platform/macros.h" // #include "tensorflow/core/platform/types.h" // Forward declaration. @Namespace("tensorflow") @Opaque public static class TensorCApi extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TensorCApi() { super((Pointer)null); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public TensorCApi(Pointer p) { super(p); } } /** Represents an n-dimensional array of values. */ @Namespace("tensorflow") @NoOffset public static class Tensor extends AbstractTensor { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public Tensor(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public Tensor(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public Tensor position(long position) { return (Tensor)super.position(position); } /** Default Tensor constructor. Creates a 1-dimension, 0-element float tensor. */ /// public Tensor() { super((Pointer)null); allocate(); } private native void allocate(); /** \brief Creates a Tensor of the given {@code type} and {@code shape}. If * LogMemory::IsEnabled() the allocation is logged as coming from * an unknown kernel and step. Calling the Tensor constructor * directly from within an Op is deprecated: use the * OpKernelConstruction/OpKernelContext allocate_* methods to * allocate a new tensor, which record the kernel and step. * * The underlying buffer is allocated using a {@code CPUAllocator}. */ /// public Tensor(@Cast("tensorflow::DataType") int type, @Const @ByRef TensorShape shape) { super((Pointer)null); allocate(type, shape); } private native void allocate(@Cast("tensorflow::DataType") int type, @Const @ByRef TensorShape shape); /** \brief Creates a tensor with the input {@code type} and {@code shape}, using * the allocator {@code a} to allocate the underlying buffer. If * LogMemory::IsEnabled() the allocation is logged as coming from * an unknown kernel and step. Calling the Tensor constructor * directly from within an Op is deprecated: use the * OpKernelConstruction/OpKernelContext allocate_* methods to * allocate a new tensor, which record the kernel and step. * * {@code a} must outlive the lifetime of this Tensor. */ /// public Tensor(Allocator a, @Cast("tensorflow::DataType") int type, @Const @ByRef TensorShape shape) { super((Pointer)null); allocate(a, type, shape); } private native void allocate(Allocator a, @Cast("tensorflow::DataType") int type, @Const @ByRef TensorShape shape); /** \brief Creates a tensor with the input {@code type} and {@code shape}, using * the allocator {@code a} and the specified "allocation_attr" to * allocate the underlying buffer. If the kernel and step are known * allocation_attr.allocation_will_be_logged should be set to true * and LogMemory::RecordTensorAllocation should be called after the * tensor is constructed. Calling the Tensor constructor directly * from within an Op is deprecated: use the * OpKernelConstruction/OpKernelContext allocate_* methods to * allocate a new tensor, which record the kernel and step. * * {@code a} must outlive the lifetime of this Tensor. */ public Tensor(Allocator a, @Cast("tensorflow::DataType") int type, @Const @ByRef TensorShape shape, @Const @ByRef AllocationAttributes allocation_attr) { super((Pointer)null); allocate(a, type, shape, allocation_attr); } private native void allocate(Allocator a, @Cast("tensorflow::DataType") int type, @Const @ByRef TensorShape shape, @Const @ByRef AllocationAttributes allocation_attr); /** Creates an uninitialized Tensor of the given data type. */ public Tensor(@Cast("tensorflow::DataType") int type) { super((Pointer)null); allocate(type); } private native void allocate(@Cast("tensorflow::DataType") int type); public Tensor(@Const @ByRef Tensor other) { super((Pointer)null); allocate(other); } private native void allocate(@Const @ByRef Tensor other); /** Copy constructor. */ /** Returns the data type. */ public native @Cast("tensorflow::DataType") int dtype(); /** Returns the shape of the tensor. */ /// public native @Const @ByRef TensorShape shape(); /** \brief Convenience accessor for the tensor shape. * * For all shape accessors, see comments for relevant methods of * {@code TensorShape} in {@code tensor_shape.h}. */ public native int dims(); /** Convenience accessor for the tensor shape. */ public native @Cast("tensorflow::int64") long dim_size(int d); /** Convenience accessor for the tensor shape. */ public native @Cast("tensorflow::int64") long NumElements(); public native @Cast("bool") boolean IsSameSize(@Const @ByRef Tensor b); // True iff the two tensors use the same underlying refcounted storage public native @Cast("bool") boolean SharesBufferWith(@Const @ByRef Tensor b); // The BufferHash of two tensors are equal when they share the same // underlying refcounted storage public native @Cast("size_t") long BufferHash(); /** Has this Tensor been initialized? */ public native @Cast("bool") boolean IsInitialized(); /** Returns the estimated memory usage of this tensor. */ public native @Cast("size_t") long TotalBytes(); /** Returns true iff this tensor is aligned. */ public native @Cast("bool") boolean IsAligned(); /** Assign operator. This tensor shares other's underlying storage. */ /// public native @ByRef @Name("operator =") Tensor put(@Const @ByRef Tensor other); /** \brief Copy the other tensor into this tensor and reshape it. * * This tensor shares other's underlying storage. Returns {@code true} * iff {@code other.shape()} has the same number of elements of the given * {@code shape}. */ /// /// public native @Cast("bool") boolean CopyFrom(@Const @ByRef Tensor other, @Const @ByRef TensorShape shape); /** \brief Slice this tensor along the 1st dimension.

* I.e., the returned tensor satisfies * returned[i, ...] == this[dim0_start + i, ...]. * The returned tensor shares the underlying tensor buffer with this * tensor. * * NOTE: The returned tensor may not satisfies the same alignment * requirement as this tensor depending on the shape. The caller * must check the returned tensor's alignment before calling certain * methods that have alignment requirement (e.g., {@code flat()}, {@code tensor()}). * * REQUIRES: {@code dims()} >= 1 * REQUIRES: {@code 0 <= dim0_start <= dim0_limit <= dim_size(0)} */ public native @ByVal Tensor Slice(@Cast("tensorflow::int64") long dim0_start, @Cast("tensorflow::int64") long dim0_limit); /** \brief Parse {@code other} and construct the tensor.

* Returns {@code true} iff the parsing succeeds. If the parsing fails, * the state of {@code *this} is unchanged. */ public native @Cast("bool") boolean FromProto(@Const @ByRef TensorProto other); /// public native @Cast("bool") boolean FromProto(Allocator a, @Const @ByRef TensorProto other); /** \brief Fills in {@code proto} with {@code *this} tensor's content. * * {@code AsProtoField()} fills in the repeated field for {@code proto.dtype()}, while * {@code AsProtoTensorContent()} encodes the content in {@code proto.tensor_content()} * in a compact form. */ public native void AsProtoField(TensorProto proto); /// /// /// /// /// public native void AsProtoTensorContent(TensorProto proto); /** \brief Return the tensor data as an {@code Eigen::Tensor} with the type and * sizes of this {@code Tensor}. * * Use these methods when you know the data type and the number of * dimensions of the Tensor and you want an {@code Eigen::Tensor} * automatically sized to the {@code Tensor} sizes. The implementation check * fails if either type or sizes mismatch. * * Example: * *

{@code c++
   * 
   *      typedef float T;
   *      Tensor my_mat(...built with Shape{rows: 3, cols: 5}...);
   *      auto mat = my_mat.matrix();    // 2D Eigen::Tensor, 3 x 5.
   *      auto mat = my_mat.tensor(); // 2D Eigen::Tensor, 3 x 5.
   *      auto vec = my_mat.vec();       // CHECK fails as my_mat is 2D.
   *      auto vec = my_mat.tensor(); // CHECK fails as my_mat is 2D.
   *      auto mat = my_mat.matrix();// CHECK fails as type mismatch.
   * 
   *  }
*/ /** \brief Return the tensor data as an {@code Eigen::Tensor} of the data type and a * specified shape. * * These methods allow you to access the data with the dimensions * and sizes of your choice. You do not need to know the number of * dimensions of the Tensor to call them. However, they {@code CHECK} that * the type matches and the dimensions requested creates an * {@code Eigen::Tensor} with the same number of elements as the tensor. * * Example: * *
{@code c++
   * 
   *      typedef float T;
   *      Tensor my_ten(...built with Shape{planes: 4, rows: 3, cols: 5}...);
   *      // 1D Eigen::Tensor, size 60:
   *      auto flat = my_ten.flat();
   *      // 2D Eigen::Tensor 12 x 5:
   *      auto inner = my_ten.flat_inner_dims();
   *      // 2D Eigen::Tensor 4 x 15:
   *      auto outer = my_ten.shaped({4, 15});
   *      // CHECK fails, bad num elements:
   *      auto outer = my_ten.shaped({4, 8});
   *      // 3D Eigen::Tensor 6 x 5 x 2:
   *      auto weird = my_ten.shaped({6, 5, 2});
   *      // CHECK fails, type mismatch:
   *      auto bad   = my_ten.flat();
   * 
   *  }
*/ /** Returns the data as an Eigen::Tensor with NDIMS dimensions, collapsing all * Tensor dimensions but the last NDIMS-1 into the first dimension of the * result. If NDIMS > dims() then leading dimensions of size 1 will be * added to make the output rank NDIMS. */ /** Returns the data as an Eigen::Tensor with NDIMS dimensions, collapsing all * Tensor dimensions but the first NDIMS-1 into the last dimension of the * result. If NDIMS > dims() then trailing dimensions of size 1 will be * added to make the output rank NDIMS. */ /** \brief Return the Tensor data as a {@code TensorMap} of fixed size 1: * {@code TensorMap>}.

* Using {@code scalar()} allows the compiler to perform optimizations as * the size of the tensor is known at compile time. */ /** Const versions of all the methods above. */ /** Render the first {@code max_entries} values in {@code *this} into a string. */ public native @StdString BytePointer SummarizeValue(@Cast("tensorflow::int64") long max_entries); /** A human-readable summary of the tensor suitable for debugging. */ public native @StdString BytePointer DebugString(); /** Fill in the {@code TensorDescription} proto with metadata about the * tensor that is useful for monitoring and debugging. */ /// /// /// public native void FillDescription(TensorDescription description); /** \brief Returns a {@code StringPiece} mapping the current tensor's buffer. * * The returned {@code StringPiece} may point to memory location on devices * that the CPU cannot address directly. * * NOTE: The underlying tensor buffer is refcounted, so the lifetime * of the contents mapped by the {@code StringPiece} matches the lifetime of * the buffer; callers should arrange to make sure the buffer does * not get destroyed while the {@code StringPiece} is still used. * * REQUIRES: {@code DataTypeCanUseMemcpy(dtype())}. */ /// public native @StringPiece BytePointer tensor_data(); /** Copy the other tensor into this tensor and reshape it and reinterpret the * buffer's datatype. * * This tensor shares other's underlying storage. */ public native void UnsafeCopyFromInternal(@Const @ByRef Tensor arg0, @Const @ByRef TensorShape arg1); } // Implementation details // Interface to access the raw ref-counted data buffer. @Namespace("tensorflow") public static class TensorBuffer extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public TensorBuffer(Pointer p) { super(p); } // data() points to a memory region of size() bytes. public native Pointer data(); public native @Cast("size_t") long size(); // If this TensorBuffer is sub-buffer of another TensorBuffer, // returns that TensorBuffer. Otherwise, returns this. public native TensorBuffer root_buffer(); // Fill metadata about the allocation into the proto. public native void FillAllocationDescription( AllocationDescription proto); } // namespace tensorflow // #endif // TENSORFLOW_CORE_FRAMEWORK_TENSOR_H_ // Parsed from tensorflow/core/framework/attr_value.pb.h // Generated by the protocol buffer compiler. DO NOT EDIT! // source: tensorflow/core/framework/attr_value.proto // #ifndef PROTOBUF_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto__INCLUDED // #define PROTOBUF_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto__INCLUDED // #include // #include // #if GOOGLE_PROTOBUF_VERSION < 3000000 // #error This file was generated by a newer version of protoc which is // #error incompatible with your Protocol Buffer headers. Please update // #error your headers. // #endif // #if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION // #error This file was generated by an older version of protoc which is // #error incompatible with your Protocol Buffer headers. Please // #error regenerate this file with a newer version of protoc. // #endif // #include // #include // #include // #include // #include // #include // #include // #include // #include // #include // #include "tensorflow/core/framework/tensor.pb.h" // #include "tensorflow/core/framework/tensor_shape.pb.h" // #include "tensorflow/core/framework/types.pb.h" // @@protoc_insertion_point(includes) // Internal implementation detail -- do not call these. @Namespace("tensorflow") public static native void protobuf_AddDesc_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto(); @Namespace("tensorflow") public static native void protobuf_AssignDesc_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto(); @Namespace("tensorflow") public static native void protobuf_ShutdownFile_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto(); // =================================================================== @Namespace("tensorflow") @NoOffset public static class AttrValue_ListValue extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public AttrValue_ListValue(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public AttrValue_ListValue(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public AttrValue_ListValue position(long position) { return (AttrValue_ListValue)super.position(position); } public AttrValue_ListValue() { super((Pointer)null); allocate(); } private native void allocate(); public AttrValue_ListValue(@Const @ByRef AttrValue_ListValue from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef AttrValue_ListValue from); public native @ByRef @Name("operator =") AttrValue_ListValue put(@Const @ByRef AttrValue_ListValue from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef AttrValue_ListValue default_instance(); public native void Swap(AttrValue_ListValue other); // implements Message ---------------------------------------------- public native AttrValue_ListValue New(); public native AttrValue_ListValue New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef AttrValue_ListValue from); public native void MergeFrom(@Const @ByRef AttrValue_ListValue from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // repeated bytes s = 2; public native int s_size(); public native void clear_s(); @MemberGetter public static native int kSFieldNumber(); public static final int kSFieldNumber = kSFieldNumber(); public native @StdString BytePointer s(int index); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_s(int index); public native void set_s(int index, @StdString BytePointer value); public native void set_s(int index, @StdString String value); public native void set_s(int index, @Const Pointer value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer add_s(); public native void add_s(@StdString BytePointer value); public native void add_s(@StdString String value); public native void add_s(@Const Pointer value, @Cast("size_t") long size); // repeated int64 i = 3 [packed = true]; public native int i_size(); public native void clear_i(); @MemberGetter public static native int kIFieldNumber(); public static final int kIFieldNumber = kIFieldNumber(); public native @Cast("google::protobuf::int64") long i(int index); public native void set_i(int index, @Cast("google::protobuf::int64") long value); public native void add_i(@Cast("google::protobuf::int64") long value); // repeated float f = 4 [packed = true]; public native int f_size(); public native void clear_f(); @MemberGetter public static native int kFFieldNumber(); public static final int kFFieldNumber = kFFieldNumber(); public native float f(int index); public native void set_f(int index, float value); public native void add_f(float value); // repeated bool b = 5 [packed = true]; public native int b_size(); public native void clear_b(); @MemberGetter public static native int kBFieldNumber(); public static final int kBFieldNumber = kBFieldNumber(); public native @Cast("bool") boolean b(int index); public native void set_b(int index, @Cast("bool") boolean value); public native void add_b(@Cast("bool") boolean value); // repeated .tensorflow.DataType type = 6 [packed = true]; public native int type_size(); public native void clear_type(); @MemberGetter public static native int kTypeFieldNumber(); public static final int kTypeFieldNumber = kTypeFieldNumber(); public native @Cast("tensorflow::DataType") int type(int index); public native void set_type(int index, @Cast("tensorflow::DataType") int value); public native void add_type(@Cast("tensorflow::DataType") int value); // repeated .tensorflow.TensorShapeProto shape = 7; public native int shape_size(); public native void clear_shape(); @MemberGetter public static native int kShapeFieldNumber(); public static final int kShapeFieldNumber = kShapeFieldNumber(); public native @Const @ByRef TensorShapeProto shape(int index); public native TensorShapeProto mutable_shape(int index); public native TensorShapeProto add_shape(); // repeated .tensorflow.TensorProto tensor = 8; public native int tensor_size(); public native void clear_tensor(); @MemberGetter public static native int kTensorFieldNumber(); public static final int kTensorFieldNumber = kTensorFieldNumber(); public native @Const @ByRef TensorProto tensor(int index); public native TensorProto mutable_tensor(int index); public native TensorProto add_tensor(); } // ------------------------------------------------------------------- @Namespace("tensorflow") @NoOffset public static class AttrValue extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public AttrValue(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public AttrValue(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public AttrValue position(long position) { return (AttrValue)super.position(position); } public AttrValue() { super((Pointer)null); allocate(); } private native void allocate(); public AttrValue(@Const @ByRef AttrValue from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef AttrValue from); public native @ByRef @Name("operator =") AttrValue put(@Const @ByRef AttrValue from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef AttrValue default_instance(); /** enum tensorflow::AttrValue::ValueCase */ public static final int kS = 2, kI = 3, kF = 4, kB = 5, kType = 6, kShape = 7, kTensor = 8, kList = 1, kFunc = 10, kPlaceholder = 9, VALUE_NOT_SET = 0; public native void Swap(AttrValue other); // implements Message ---------------------------------------------- public native AttrValue New(); public native AttrValue New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef AttrValue from); public native void MergeFrom(@Const @ByRef AttrValue from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- public native void clear_s(); @MemberGetter public static native int kSFieldNumber(); public static final int kSFieldNumber = kSFieldNumber(); public native @StdString BytePointer s(); public native void set_s(@StdString BytePointer value); public native void set_s(@StdString String value); public native void set_s(@Const Pointer value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_s(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_s(); public native void set_allocated_s(@StdString @Cast({"char*", "std::string*"}) BytePointer s); public native void clear_i(); @MemberGetter public static native int kIFieldNumber(); public static final int kIFieldNumber = kIFieldNumber(); public native @Cast("google::protobuf::int64") long i(); public native void set_i(@Cast("google::protobuf::int64") long value); public native void clear_f(); @MemberGetter public static native int kFFieldNumber(); public static final int kFFieldNumber = kFFieldNumber(); public native float f(); public native void set_f(float value); public native void clear_b(); @MemberGetter public static native int kBFieldNumber(); public static final int kBFieldNumber = kBFieldNumber(); public native @Cast("bool") boolean b(); public native void set_b(@Cast("bool") boolean value); public native void clear_type(); @MemberGetter public static native int kTypeFieldNumber(); public static final int kTypeFieldNumber = kTypeFieldNumber(); public native @Cast("tensorflow::DataType") int type(); public native void set_type(@Cast("tensorflow::DataType") int value); // optional .tensorflow.TensorShapeProto shape = 7; public native @Cast("bool") boolean has_shape(); public native void clear_shape(); @MemberGetter public static native int kShapeFieldNumber(); public static final int kShapeFieldNumber = kShapeFieldNumber(); public native @Const @ByRef TensorShapeProto shape(); public native TensorShapeProto mutable_shape(); public native TensorShapeProto release_shape(); public native void set_allocated_shape(TensorShapeProto shape); // optional .tensorflow.TensorProto tensor = 8; public native @Cast("bool") boolean has_tensor(); public native void clear_tensor(); @MemberGetter public static native int kTensorFieldNumber(); public static final int kTensorFieldNumber = kTensorFieldNumber(); public native @Const @ByRef TensorProto tensor(); public native TensorProto mutable_tensor(); public native TensorProto release_tensor(); public native void set_allocated_tensor(TensorProto tensor); // optional .tensorflow.AttrValue.ListValue list = 1; public native @Cast("bool") boolean has_list(); public native void clear_list(); @MemberGetter public static native int kListFieldNumber(); public static final int kListFieldNumber = kListFieldNumber(); public native @Const @ByRef AttrValue_ListValue list(); public native AttrValue_ListValue mutable_list(); public native AttrValue_ListValue release_list(); public native void set_allocated_list(AttrValue_ListValue list); // optional .tensorflow.NameAttrList func = 10; public native @Cast("bool") boolean has_func(); public native void clear_func(); @MemberGetter public static native int kFuncFieldNumber(); public static final int kFuncFieldNumber = kFuncFieldNumber(); public native @Const @ByRef NameAttrList func(); public native NameAttrList mutable_func(); public native NameAttrList release_func(); public native void set_allocated_func(NameAttrList func); public native void clear_placeholder(); @MemberGetter public static native int kPlaceholderFieldNumber(); public static final int kPlaceholderFieldNumber = kPlaceholderFieldNumber(); public native @StdString BytePointer placeholder(); public native void set_placeholder(@StdString BytePointer value); public native void set_placeholder(@StdString String value); public native void set_placeholder(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_placeholder(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_placeholder(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_placeholder(); public native void set_allocated_placeholder(@StdString @Cast({"char*", "std::string*"}) BytePointer placeholder); public native @Cast("tensorflow::AttrValue::ValueCase") int value_case(); } // ------------------------------------------------------------------- @Namespace("tensorflow") @NoOffset public static class NameAttrList extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public NameAttrList(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public NameAttrList(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public NameAttrList position(long position) { return (NameAttrList)super.position(position); } public NameAttrList() { super((Pointer)null); allocate(); } private native void allocate(); public NameAttrList(@Const @ByRef NameAttrList from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef NameAttrList from); public native @ByRef @Name("operator =") NameAttrList put(@Const @ByRef NameAttrList from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef NameAttrList default_instance(); public native void Swap(NameAttrList other); // implements Message ---------------------------------------------- public native NameAttrList New(); public native NameAttrList New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef NameAttrList from); public native void MergeFrom(@Const @ByRef NameAttrList from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // optional string name = 1; public native void clear_name(); @MemberGetter public static native int kNameFieldNumber(); public static final int kNameFieldNumber = kNameFieldNumber(); public native @StdString BytePointer name(); public native void set_name(@StdString BytePointer value); public native void set_name(@StdString String value); public native void set_name(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_name(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_name(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_name(); public native void set_allocated_name(@StdString @Cast({"char*", "std::string*"}) BytePointer name); // map attr = 2; public native int attr_size(); public native void clear_attr(); @MemberGetter public static native int kAttrFieldNumber(); public static final int kAttrFieldNumber = kAttrFieldNumber(); public native @Const @ByRef StringAttrValueMap attr(); public native StringAttrValueMap mutable_attr(); } // =================================================================== // =================================================================== // #if !PROTOBUF_INLINE_NOT_IN_HEADERS // AttrValue_ListValue // repeated bytes s = 2; // repeated int64 i = 3 [packed = true]; // repeated float f = 4 [packed = true]; // repeated bool b = 5 [packed = true]; // repeated .tensorflow.DataType type = 6 [packed = true]; // repeated .tensorflow.TensorShapeProto shape = 7; // repeated .tensorflow.TensorProto tensor = 8; // ------------------------------------------------------------------- // AttrValue // optional bytes s = 2; // optional int64 i = 3; // optional float f = 4; // optional bool b = 5; // optional .tensorflow.DataType type = 6; // optional .tensorflow.TensorShapeProto shape = 7; // optional .tensorflow.TensorProto tensor = 8; // optional .tensorflow.AttrValue.ListValue list = 1; // optional .tensorflow.NameAttrList func = 10; // optional string placeholder = 9; // ------------------------------------------------------------------- // NameAttrList // optional string name = 1; // map attr = 2; // #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // ------------------------------------------------------------------- // ------------------------------------------------------------------- // @@protoc_insertion_point(namespace_scope) // namespace tensorflow // @@protoc_insertion_point(global_scope) // #endif // PROTOBUF_tensorflow_2fcore_2fframework_2fattr_5fvalue_2eproto__INCLUDED // Parsed from tensorflow/core/framework/op_def.pb.h // Generated by the protocol buffer compiler. DO NOT EDIT! // source: tensorflow/core/framework/op_def.proto // #ifndef PROTOBUF_tensorflow_2fcore_2fframework_2fop_5fdef_2eproto__INCLUDED // #define PROTOBUF_tensorflow_2fcore_2fframework_2fop_5fdef_2eproto__INCLUDED // #include // #include // #if GOOGLE_PROTOBUF_VERSION < 3000000 // #error This file was generated by a newer version of protoc which is // #error incompatible with your Protocol Buffer headers. Please update // #error your headers. // #endif // #if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION // #error This file was generated by an older version of protoc which is // #error incompatible with your Protocol Buffer headers. Please // #error regenerate this file with a newer version of protoc. // #endif // #include // #include // #include // #include // #include // #include // #include // #include // #include "tensorflow/core/framework/attr_value.pb.h" // #include "tensorflow/core/framework/types.pb.h" // @@protoc_insertion_point(includes) // Internal implementation detail -- do not call these. @Namespace("tensorflow") public static native void protobuf_AddDesc_tensorflow_2fcore_2fframework_2fop_5fdef_2eproto(); @Namespace("tensorflow") public static native void protobuf_AssignDesc_tensorflow_2fcore_2fframework_2fop_5fdef_2eproto(); @Namespace("tensorflow") public static native void protobuf_ShutdownFile_tensorflow_2fcore_2fframework_2fop_5fdef_2eproto(); // =================================================================== @Namespace("tensorflow") @NoOffset public static class OpDef_ArgDef extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public OpDef_ArgDef(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public OpDef_ArgDef(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public OpDef_ArgDef position(long position) { return (OpDef_ArgDef)super.position(position); } public OpDef_ArgDef() { super((Pointer)null); allocate(); } private native void allocate(); public OpDef_ArgDef(@Const @ByRef OpDef_ArgDef from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef OpDef_ArgDef from); public native @ByRef @Name("operator =") OpDef_ArgDef put(@Const @ByRef OpDef_ArgDef from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef OpDef_ArgDef default_instance(); public native void Swap(OpDef_ArgDef other); // implements Message ---------------------------------------------- public native OpDef_ArgDef New(); public native OpDef_ArgDef New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef OpDef_ArgDef from); public native void MergeFrom(@Const @ByRef OpDef_ArgDef from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // optional string name = 1; public native void clear_name(); @MemberGetter public static native int kNameFieldNumber(); public static final int kNameFieldNumber = kNameFieldNumber(); public native @StdString BytePointer name(); public native void set_name(@StdString BytePointer value); public native void set_name(@StdString String value); public native void set_name(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_name(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_name(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_name(); public native void set_allocated_name(@StdString @Cast({"char*", "std::string*"}) BytePointer name); // optional string description = 2; public native void clear_description(); @MemberGetter public static native int kDescriptionFieldNumber(); public static final int kDescriptionFieldNumber = kDescriptionFieldNumber(); public native @StdString BytePointer description(); public native void set_description(@StdString BytePointer value); public native void set_description(@StdString String value); public native void set_description(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_description(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_description(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_description(); public native void set_allocated_description(@StdString @Cast({"char*", "std::string*"}) BytePointer description); // optional .tensorflow.DataType type = 3; public native void clear_type(); @MemberGetter public static native int kTypeFieldNumber(); public static final int kTypeFieldNumber = kTypeFieldNumber(); public native @Cast("tensorflow::DataType") int type(); public native void set_type(@Cast("tensorflow::DataType") int value); // optional string type_attr = 4; public native void clear_type_attr(); @MemberGetter public static native int kTypeAttrFieldNumber(); public static final int kTypeAttrFieldNumber = kTypeAttrFieldNumber(); public native @StdString BytePointer type_attr(); public native void set_type_attr(@StdString BytePointer value); public native void set_type_attr(@StdString String value); public native void set_type_attr(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_type_attr(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_type_attr(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_type_attr(); public native void set_allocated_type_attr(@StdString @Cast({"char*", "std::string*"}) BytePointer type_attr); // optional string number_attr = 5; public native void clear_number_attr(); @MemberGetter public static native int kNumberAttrFieldNumber(); public static final int kNumberAttrFieldNumber = kNumberAttrFieldNumber(); public native @StdString BytePointer number_attr(); public native void set_number_attr(@StdString BytePointer value); public native void set_number_attr(@StdString String value); public native void set_number_attr(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_number_attr(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_number_attr(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_number_attr(); public native void set_allocated_number_attr(@StdString @Cast({"char*", "std::string*"}) BytePointer number_attr); // optional string type_list_attr = 6; public native void clear_type_list_attr(); @MemberGetter public static native int kTypeListAttrFieldNumber(); public static final int kTypeListAttrFieldNumber = kTypeListAttrFieldNumber(); public native @StdString BytePointer type_list_attr(); public native void set_type_list_attr(@StdString BytePointer value); public native void set_type_list_attr(@StdString String value); public native void set_type_list_attr(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_type_list_attr(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_type_list_attr(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_type_list_attr(); public native void set_allocated_type_list_attr(@StdString @Cast({"char*", "std::string*"}) BytePointer type_list_attr); // optional bool is_ref = 16; public native void clear_is_ref(); @MemberGetter public static native int kIsRefFieldNumber(); public static final int kIsRefFieldNumber = kIsRefFieldNumber(); public native @Cast("bool") boolean is_ref(); public native void set_is_ref(@Cast("bool") boolean value); } // ------------------------------------------------------------------- @Namespace("tensorflow") @NoOffset public static class OpDef_AttrDef extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public OpDef_AttrDef(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public OpDef_AttrDef(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public OpDef_AttrDef position(long position) { return (OpDef_AttrDef)super.position(position); } public OpDef_AttrDef() { super((Pointer)null); allocate(); } private native void allocate(); public OpDef_AttrDef(@Const @ByRef OpDef_AttrDef from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef OpDef_AttrDef from); public native @ByRef @Name("operator =") OpDef_AttrDef put(@Const @ByRef OpDef_AttrDef from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef OpDef_AttrDef default_instance(); public native void Swap(OpDef_AttrDef other); // implements Message ---------------------------------------------- public native OpDef_AttrDef New(); public native OpDef_AttrDef New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef OpDef_AttrDef from); public native void MergeFrom(@Const @ByRef OpDef_AttrDef from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // optional string name = 1; public native void clear_name(); @MemberGetter public static native int kNameFieldNumber(); public static final int kNameFieldNumber = kNameFieldNumber(); public native @StdString BytePointer name(); public native void set_name(@StdString BytePointer value); public native void set_name(@StdString String value); public native void set_name(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_name(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_name(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_name(); public native void set_allocated_name(@StdString @Cast({"char*", "std::string*"}) BytePointer name); // optional string type = 2; public native void clear_type(); @MemberGetter public static native int kTypeFieldNumber(); public static final int kTypeFieldNumber = kTypeFieldNumber(); public native @StdString BytePointer type(); public native void set_type(@StdString BytePointer value); public native void set_type(@StdString String value); public native void set_type(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_type(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_type(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_type(); public native void set_allocated_type(@StdString @Cast({"char*", "std::string*"}) BytePointer type); // optional .tensorflow.AttrValue default_value = 3; public native @Cast("bool") boolean has_default_value(); public native void clear_default_value(); @MemberGetter public static native int kDefaultValueFieldNumber(); public static final int kDefaultValueFieldNumber = kDefaultValueFieldNumber(); public native @Const @ByRef AttrValue default_value(); public native AttrValue mutable_default_value(); public native AttrValue release_default_value(); public native void set_allocated_default_value(AttrValue default_value); // optional string description = 4; public native void clear_description(); @MemberGetter public static native int kDescriptionFieldNumber(); public static final int kDescriptionFieldNumber = kDescriptionFieldNumber(); public native @StdString BytePointer description(); public native void set_description(@StdString BytePointer value); public native void set_description(@StdString String value); public native void set_description(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_description(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_description(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_description(); public native void set_allocated_description(@StdString @Cast({"char*", "std::string*"}) BytePointer description); // optional bool has_minimum = 5; public native void clear_has_minimum(); @MemberGetter public static native int kHasMinimumFieldNumber(); public static final int kHasMinimumFieldNumber = kHasMinimumFieldNumber(); public native @Cast("bool") boolean has_minimum(); public native void set_has_minimum(@Cast("bool") boolean value); // optional int64 minimum = 6; public native void clear_minimum(); @MemberGetter public static native int kMinimumFieldNumber(); public static final int kMinimumFieldNumber = kMinimumFieldNumber(); public native @Cast("google::protobuf::int64") long minimum(); public native void set_minimum(@Cast("google::protobuf::int64") long value); // optional .tensorflow.AttrValue allowed_values = 7; public native @Cast("bool") boolean has_allowed_values(); public native void clear_allowed_values(); @MemberGetter public static native int kAllowedValuesFieldNumber(); public static final int kAllowedValuesFieldNumber = kAllowedValuesFieldNumber(); public native @Const @ByRef AttrValue allowed_values(); public native AttrValue mutable_allowed_values(); public native AttrValue release_allowed_values(); public native void set_allocated_allowed_values(AttrValue allowed_values); } // ------------------------------------------------------------------- @Namespace("tensorflow") @NoOffset public static class OpDef extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public OpDef(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public OpDef(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public OpDef position(long position) { return (OpDef)super.position(position); } public OpDef() { super((Pointer)null); allocate(); } private native void allocate(); public OpDef(@Const @ByRef OpDef from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef OpDef from); public native @ByRef @Name("operator =") OpDef put(@Const @ByRef OpDef from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef OpDef default_instance(); public native void Swap(OpDef other); // implements Message ---------------------------------------------- public native OpDef New(); public native OpDef New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef OpDef from); public native void MergeFrom(@Const @ByRef OpDef from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // optional string name = 1; public native void clear_name(); @MemberGetter public static native int kNameFieldNumber(); public static final int kNameFieldNumber = kNameFieldNumber(); public native @StdString BytePointer name(); public native void set_name(@StdString BytePointer value); public native void set_name(@StdString String value); public native void set_name(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_name(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_name(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_name(); public native void set_allocated_name(@StdString @Cast({"char*", "std::string*"}) BytePointer name); // repeated .tensorflow.OpDef.ArgDef input_arg = 2; public native int input_arg_size(); public native void clear_input_arg(); @MemberGetter public static native int kInputArgFieldNumber(); public static final int kInputArgFieldNumber = kInputArgFieldNumber(); public native @Const @ByRef OpDef_ArgDef input_arg(int index); public native OpDef_ArgDef mutable_input_arg(int index); public native OpDef_ArgDef add_input_arg(); // repeated .tensorflow.OpDef.ArgDef output_arg = 3; public native int output_arg_size(); public native void clear_output_arg(); @MemberGetter public static native int kOutputArgFieldNumber(); public static final int kOutputArgFieldNumber = kOutputArgFieldNumber(); public native @Const @ByRef OpDef_ArgDef output_arg(int index); public native OpDef_ArgDef mutable_output_arg(int index); public native OpDef_ArgDef add_output_arg(); // repeated .tensorflow.OpDef.AttrDef attr = 4; public native int attr_size(); public native void clear_attr(); @MemberGetter public static native int kAttrFieldNumber(); public static final int kAttrFieldNumber = kAttrFieldNumber(); public native @Const @ByRef OpDef_AttrDef attr(int index); public native OpDef_AttrDef mutable_attr(int index); public native OpDef_AttrDef add_attr(); // optional string summary = 5; public native void clear_summary(); @MemberGetter public static native int kSummaryFieldNumber(); public static final int kSummaryFieldNumber = kSummaryFieldNumber(); public native @StdString BytePointer summary(); public native void set_summary(@StdString BytePointer value); public native void set_summary(@StdString String value); public native void set_summary(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_summary(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_summary(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_summary(); public native void set_allocated_summary(@StdString @Cast({"char*", "std::string*"}) BytePointer summary); // optional string description = 6; public native void clear_description(); @MemberGetter public static native int kDescriptionFieldNumber(); public static final int kDescriptionFieldNumber = kDescriptionFieldNumber(); public native @StdString BytePointer description(); public native void set_description(@StdString BytePointer value); public native void set_description(@StdString String value); public native void set_description(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_description(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_description(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_description(); public native void set_allocated_description(@StdString @Cast({"char*", "std::string*"}) BytePointer description); // optional bool is_commutative = 18; public native void clear_is_commutative(); @MemberGetter public static native int kIsCommutativeFieldNumber(); public static final int kIsCommutativeFieldNumber = kIsCommutativeFieldNumber(); public native @Cast("bool") boolean is_commutative(); public native void set_is_commutative(@Cast("bool") boolean value); // optional bool is_aggregate = 16; public native void clear_is_aggregate(); @MemberGetter public static native int kIsAggregateFieldNumber(); public static final int kIsAggregateFieldNumber = kIsAggregateFieldNumber(); public native @Cast("bool") boolean is_aggregate(); public native void set_is_aggregate(@Cast("bool") boolean value); // optional bool is_stateful = 17; public native void clear_is_stateful(); @MemberGetter public static native int kIsStatefulFieldNumber(); public static final int kIsStatefulFieldNumber = kIsStatefulFieldNumber(); public native @Cast("bool") boolean is_stateful(); public native void set_is_stateful(@Cast("bool") boolean value); // optional bool allows_uninitialized_input = 19; public native void clear_allows_uninitialized_input(); @MemberGetter public static native int kAllowsUninitializedInputFieldNumber(); public static final int kAllowsUninitializedInputFieldNumber = kAllowsUninitializedInputFieldNumber(); public native @Cast("bool") boolean allows_uninitialized_input(); public native void set_allows_uninitialized_input(@Cast("bool") boolean value); } // ------------------------------------------------------------------- @Namespace("tensorflow") @NoOffset public static class OpList extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public OpList(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public OpList(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public OpList position(long position) { return (OpList)super.position(position); } public OpList() { super((Pointer)null); allocate(); } private native void allocate(); public OpList(@Const @ByRef OpList from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef OpList from); public native @ByRef @Name("operator =") OpList put(@Const @ByRef OpList from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef OpList default_instance(); public native void Swap(OpList other); // implements Message ---------------------------------------------- public native OpList New(); public native OpList New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef OpList from); public native void MergeFrom(@Const @ByRef OpList from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // repeated .tensorflow.OpDef op = 1; public native int op_size(); public native void clear_op(); @MemberGetter public static native int kOpFieldNumber(); public static final int kOpFieldNumber = kOpFieldNumber(); public native @Const @ByRef OpDef op(int index); public native OpDef mutable_op(int index); public native OpDef add_op(); } // =================================================================== // =================================================================== // #if !PROTOBUF_INLINE_NOT_IN_HEADERS // OpDef_ArgDef // optional string name = 1; // optional string description = 2; // optional .tensorflow.DataType type = 3; // optional string type_attr = 4; // optional string number_attr = 5; // optional string type_list_attr = 6; // optional bool is_ref = 16; // ------------------------------------------------------------------- // OpDef_AttrDef // optional string name = 1; // optional string type = 2; // optional .tensorflow.AttrValue default_value = 3; // optional string description = 4; // optional bool has_minimum = 5; // optional int64 minimum = 6; // optional .tensorflow.AttrValue allowed_values = 7; // ------------------------------------------------------------------- // OpDef // optional string name = 1; // repeated .tensorflow.OpDef.ArgDef input_arg = 2; // repeated .tensorflow.OpDef.ArgDef output_arg = 3; // repeated .tensorflow.OpDef.AttrDef attr = 4; // optional string summary = 5; // optional string description = 6; // optional bool is_commutative = 18; // optional bool is_aggregate = 16; // optional bool is_stateful = 17; // optional bool allows_uninitialized_input = 19; // ------------------------------------------------------------------- // OpList // repeated .tensorflow.OpDef op = 1; // #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // @@protoc_insertion_point(namespace_scope) // namespace tensorflow // @@protoc_insertion_point(global_scope) // #endif // PROTOBUF_tensorflow_2fcore_2fframework_2fop_5fdef_2eproto__INCLUDED // Parsed from tensorflow/core/framework/function.pb.h // Generated by the protocol buffer compiler. DO NOT EDIT! // source: tensorflow/core/framework/function.proto // #ifndef PROTOBUF_tensorflow_2fcore_2fframework_2ffunction_2eproto__INCLUDED // #define PROTOBUF_tensorflow_2fcore_2fframework_2ffunction_2eproto__INCLUDED // #include // #include // #if GOOGLE_PROTOBUF_VERSION < 3000000 // #error This file was generated by a newer version of protoc which is // #error incompatible with your Protocol Buffer headers. Please update // #error your headers. // #endif // #if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION // #error This file was generated by an older version of protoc which is // #error incompatible with your Protocol Buffer headers. Please // #error regenerate this file with a newer version of protoc. // #endif // #include // #include // #include // #include // #include // #include // #include // #include // #include // #include // #include "tensorflow/core/framework/attr_value.pb.h" // #include "tensorflow/core/framework/op_def.pb.h" // @@protoc_insertion_point(includes) // Internal implementation detail -- do not call these. @Namespace("tensorflow") public static native void protobuf_AddDesc_tensorflow_2fcore_2fframework_2ffunction_2eproto(); @Namespace("tensorflow") public static native void protobuf_AssignDesc_tensorflow_2fcore_2fframework_2ffunction_2eproto(); @Namespace("tensorflow") public static native void protobuf_ShutdownFile_tensorflow_2fcore_2fframework_2ffunction_2eproto(); // =================================================================== @Namespace("tensorflow") @NoOffset public static class FunctionDefLibrary extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public FunctionDefLibrary(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public FunctionDefLibrary(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public FunctionDefLibrary position(long position) { return (FunctionDefLibrary)super.position(position); } public FunctionDefLibrary() { super((Pointer)null); allocate(); } private native void allocate(); public FunctionDefLibrary(@Const @ByRef FunctionDefLibrary from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef FunctionDefLibrary from); public native @ByRef @Name("operator =") FunctionDefLibrary put(@Const @ByRef FunctionDefLibrary from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef FunctionDefLibrary default_instance(); public native void Swap(FunctionDefLibrary other); // implements Message ---------------------------------------------- public native FunctionDefLibrary New(); public native FunctionDefLibrary New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef FunctionDefLibrary from); public native void MergeFrom(@Const @ByRef FunctionDefLibrary from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // repeated .tensorflow.FunctionDef function = 1; public native int function_size(); public native void clear_function(); @MemberGetter public static native int kFunctionFieldNumber(); public static final int kFunctionFieldNumber = kFunctionFieldNumber(); public native @Const @ByRef FunctionDef function(int index); public native FunctionDef mutable_function(int index); public native FunctionDef add_function(); // repeated .tensorflow.GradientDef gradient = 2; public native int gradient_size(); public native void clear_gradient(); @MemberGetter public static native int kGradientFieldNumber(); public static final int kGradientFieldNumber = kGradientFieldNumber(); public native @Const @ByRef GradientDef gradient(int index); public native GradientDef mutable_gradient(int index); public native GradientDef add_gradient(); } // ------------------------------------------------------------------- @Namespace("tensorflow") @NoOffset public static class FunctionDef_Node extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public FunctionDef_Node(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public FunctionDef_Node(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public FunctionDef_Node position(long position) { return (FunctionDef_Node)super.position(position); } public FunctionDef_Node() { super((Pointer)null); allocate(); } private native void allocate(); public FunctionDef_Node(@Const @ByRef FunctionDef_Node from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef FunctionDef_Node from); public native @ByRef @Name("operator =") FunctionDef_Node put(@Const @ByRef FunctionDef_Node from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef FunctionDef_Node default_instance(); public native void Swap(FunctionDef_Node other); // implements Message ---------------------------------------------- public native FunctionDef_Node New(); public native FunctionDef_Node New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef FunctionDef_Node from); public native void MergeFrom(@Const @ByRef FunctionDef_Node from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // repeated string ret = 1; public native int ret_size(); public native void clear_ret(); @MemberGetter public static native int kRetFieldNumber(); public static final int kRetFieldNumber = kRetFieldNumber(); public native @StdString BytePointer ret(int index); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_ret(int index); public native void set_ret(int index, @StdString BytePointer value); public native void set_ret(int index, @StdString String value); public native void set_ret(int index, @Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_ret(int index, String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer add_ret(); public native void add_ret(@StdString BytePointer value); public native void add_ret(@StdString String value); public native void add_ret(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void add_ret(String value, @Cast("size_t") long size); // optional string op = 2; public native void clear_op(); @MemberGetter public static native int kOpFieldNumber(); public static final int kOpFieldNumber = kOpFieldNumber(); public native @StdString BytePointer op(); public native void set_op(@StdString BytePointer value); public native void set_op(@StdString String value); public native void set_op(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_op(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_op(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_op(); public native void set_allocated_op(@StdString @Cast({"char*", "std::string*"}) BytePointer op); // repeated string arg = 3; public native int arg_size(); public native void clear_arg(); @MemberGetter public static native int kArgFieldNumber(); public static final int kArgFieldNumber = kArgFieldNumber(); public native @StdString BytePointer arg(int index); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_arg(int index); public native void set_arg(int index, @StdString BytePointer value); public native void set_arg(int index, @StdString String value); public native void set_arg(int index, @Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_arg(int index, String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer add_arg(); public native void add_arg(@StdString BytePointer value); public native void add_arg(@StdString String value); public native void add_arg(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void add_arg(String value, @Cast("size_t") long size); // repeated string dep = 4; public native int dep_size(); public native void clear_dep(); @MemberGetter public static native int kDepFieldNumber(); public static final int kDepFieldNumber = kDepFieldNumber(); public native @StdString BytePointer dep(int index); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_dep(int index); public native void set_dep(int index, @StdString BytePointer value); public native void set_dep(int index, @StdString String value); public native void set_dep(int index, @Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_dep(int index, String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer add_dep(); public native void add_dep(@StdString BytePointer value); public native void add_dep(@StdString String value); public native void add_dep(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void add_dep(String value, @Cast("size_t") long size); // map attr = 5; public native int attr_size(); public native void clear_attr(); @MemberGetter public static native int kAttrFieldNumber(); public static final int kAttrFieldNumber = kAttrFieldNumber(); public native @Const @ByRef StringAttrValueMap attr(); public native StringAttrValueMap mutable_attr(); } // ------------------------------------------------------------------- @Namespace("tensorflow") @NoOffset public static class FunctionDef extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public FunctionDef(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public FunctionDef(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public FunctionDef position(long position) { return (FunctionDef)super.position(position); } public FunctionDef() { super((Pointer)null); allocate(); } private native void allocate(); public FunctionDef(@Const @ByRef FunctionDef from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef FunctionDef from); public native @ByRef @Name("operator =") FunctionDef put(@Const @ByRef FunctionDef from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef FunctionDef default_instance(); public native void Swap(FunctionDef other); // implements Message ---------------------------------------------- public native FunctionDef New(); public native FunctionDef New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef FunctionDef from); public native void MergeFrom(@Const @ByRef FunctionDef from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // optional .tensorflow.OpDef signature = 1; public native @Cast("bool") boolean has_signature(); public native void clear_signature(); @MemberGetter public static native int kSignatureFieldNumber(); public static final int kSignatureFieldNumber = kSignatureFieldNumber(); public native @Const @ByRef OpDef signature(); public native OpDef mutable_signature(); public native OpDef release_signature(); public native void set_allocated_signature(OpDef signature); // repeated .tensorflow.FunctionDef.Node node = 2; public native int node_size(); public native void clear_node(); @MemberGetter public static native int kNodeFieldNumber(); public static final int kNodeFieldNumber = kNodeFieldNumber(); public native @Const @ByRef FunctionDef_Node node(int index); public native FunctionDef_Node mutable_node(int index); public native FunctionDef_Node add_node(); } // ------------------------------------------------------------------- @Namespace("tensorflow") @NoOffset public static class GradientDef extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public GradientDef(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public GradientDef(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public GradientDef position(long position) { return (GradientDef)super.position(position); } public GradientDef() { super((Pointer)null); allocate(); } private native void allocate(); public GradientDef(@Const @ByRef GradientDef from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef GradientDef from); public native @ByRef @Name("operator =") GradientDef put(@Const @ByRef GradientDef from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef GradientDef default_instance(); public native void Swap(GradientDef other); // implements Message ---------------------------------------------- public native GradientDef New(); public native GradientDef New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef GradientDef from); public native void MergeFrom(@Const @ByRef GradientDef from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // optional string function_name = 1; public native void clear_function_name(); @MemberGetter public static native int kFunctionNameFieldNumber(); public static final int kFunctionNameFieldNumber = kFunctionNameFieldNumber(); public native @StdString BytePointer function_name(); public native void set_function_name(@StdString BytePointer value); public native void set_function_name(@StdString String value); public native void set_function_name(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_function_name(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_function_name(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_function_name(); public native void set_allocated_function_name(@StdString @Cast({"char*", "std::string*"}) BytePointer function_name); // optional string gradient_func = 2; public native void clear_gradient_func(); @MemberGetter public static native int kGradientFuncFieldNumber(); public static final int kGradientFuncFieldNumber = kGradientFuncFieldNumber(); public native @StdString BytePointer gradient_func(); public native void set_gradient_func(@StdString BytePointer value); public native void set_gradient_func(@StdString String value); public native void set_gradient_func(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_gradient_func(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_gradient_func(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_gradient_func(); public native void set_allocated_gradient_func(@StdString @Cast({"char*", "std::string*"}) BytePointer gradient_func); } // =================================================================== // =================================================================== // #if !PROTOBUF_INLINE_NOT_IN_HEADERS // FunctionDefLibrary // repeated .tensorflow.FunctionDef function = 1; // repeated .tensorflow.GradientDef gradient = 2; // ------------------------------------------------------------------- // FunctionDef_Node // repeated string ret = 1; // optional string op = 2; // repeated string arg = 3; // repeated string dep = 4; // map attr = 5; // ------------------------------------------------------------------- // FunctionDef // optional .tensorflow.OpDef signature = 1; // repeated .tensorflow.FunctionDef.Node node = 2; // ------------------------------------------------------------------- // GradientDef // optional string function_name = 1; // optional string gradient_func = 2; // #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // @@protoc_insertion_point(namespace_scope) // namespace tensorflow // @@protoc_insertion_point(global_scope) // #endif // PROTOBUF_tensorflow_2fcore_2fframework_2ffunction_2eproto__INCLUDED // Parsed from tensorflow/core/framework/graph.pb.h // Generated by the protocol buffer compiler. DO NOT EDIT! // source: tensorflow/core/framework/graph.proto // #ifndef PROTOBUF_tensorflow_2fcore_2fframework_2fgraph_2eproto__INCLUDED // #define PROTOBUF_tensorflow_2fcore_2fframework_2fgraph_2eproto__INCLUDED // #include // #include // #if GOOGLE_PROTOBUF_VERSION < 3000000 // #error This file was generated by a newer version of protoc which is // #error incompatible with your Protocol Buffer headers. Please update // #error your headers. // #endif // #if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION // #error This file was generated by an older version of protoc which is // #error incompatible with your Protocol Buffer headers. Please // #error regenerate this file with a newer version of protoc. // #endif // #include // #include // #include // #include // #include // #include // #include // #include // #include // #include // #include "tensorflow/core/framework/attr_value.pb.h" // #include "tensorflow/core/framework/function.pb.h" // #include "tensorflow/core/framework/versions.pb.h" // @@protoc_insertion_point(includes) // Internal implementation detail -- do not call these. @Namespace("tensorflow") public static native void protobuf_AddDesc_tensorflow_2fcore_2fframework_2fgraph_2eproto(); @Namespace("tensorflow") public static native void protobuf_AssignDesc_tensorflow_2fcore_2fframework_2fgraph_2eproto(); @Namespace("tensorflow") public static native void protobuf_ShutdownFile_tensorflow_2fcore_2fframework_2fgraph_2eproto(); // =================================================================== @Namespace("tensorflow") @NoOffset public static class GraphDef extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public GraphDef(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public GraphDef(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public GraphDef position(long position) { return (GraphDef)super.position(position); } public GraphDef() { super((Pointer)null); allocate(); } private native void allocate(); public GraphDef(@Const @ByRef GraphDef from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef GraphDef from); public native @ByRef @Name("operator =") GraphDef put(@Const @ByRef GraphDef from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef GraphDef default_instance(); public native void Swap(GraphDef other); // implements Message ---------------------------------------------- public native GraphDef New(); public native GraphDef New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef GraphDef from); public native void MergeFrom(@Const @ByRef GraphDef from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // repeated .tensorflow.NodeDef node = 1; public native int node_size(); public native void clear_node(); @MemberGetter public static native int kNodeFieldNumber(); public static final int kNodeFieldNumber = kNodeFieldNumber(); public native @Const @ByRef NodeDef node(int index); public native NodeDef mutable_node(int index); public native NodeDef add_node(); // optional .tensorflow.VersionDef versions = 4; public native @Cast("bool") boolean has_versions(); public native void clear_versions(); @MemberGetter public static native int kVersionsFieldNumber(); public static final int kVersionsFieldNumber = kVersionsFieldNumber(); public native @Const @ByRef VersionDef versions(); public native VersionDef mutable_versions(); public native VersionDef release_versions(); public native void set_allocated_versions(VersionDef versions); // optional int32 version = 3 [deprecated = true]; public native void clear_version(); @MemberGetter public static native int kVersionFieldNumber(); public static final int kVersionFieldNumber = kVersionFieldNumber(); public native @Cast("google::protobuf::int32") int version(); public native void set_version(@Cast("google::protobuf::int32") int value); // optional .tensorflow.FunctionDefLibrary library = 2; public native @Cast("bool") boolean has_library(); public native void clear_library(); @MemberGetter public static native int kLibraryFieldNumber(); public static final int kLibraryFieldNumber = kLibraryFieldNumber(); public native @Const @ByRef FunctionDefLibrary library(); public native FunctionDefLibrary mutable_library(); public native FunctionDefLibrary release_library(); public native void set_allocated_library(FunctionDefLibrary library); } // ------------------------------------------------------------------- @Namespace("tensorflow") @NoOffset public static class NodeDef extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public NodeDef(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public NodeDef(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public NodeDef position(long position) { return (NodeDef)super.position(position); } public NodeDef() { super((Pointer)null); allocate(); } private native void allocate(); public NodeDef(@Const @ByRef NodeDef from) { super((Pointer)null); allocate(from); } private native void allocate(@Const @ByRef NodeDef from); public native @ByRef @Name("operator =") NodeDef put(@Const @ByRef NodeDef from); public static native @Cast("const google::protobuf::Descriptor*") Pointer descriptor(); public static native @Const @ByRef NodeDef default_instance(); public native void Swap(NodeDef other); // implements Message ---------------------------------------------- public native NodeDef New(); public native NodeDef New(@Cast("google::protobuf::Arena*") Pointer arena); public native void CopyFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void MergeFrom(@Cast("const google::protobuf::Message*") @ByRef Pointer from); public native void CopyFrom(@Const @ByRef NodeDef from); public native void MergeFrom(@Const @ByRef NodeDef from); public native void Clear(); public native @Cast("bool") boolean IsInitialized(); public native int ByteSize(); public native @Cast("bool") boolean MergePartialFromCodedStream( @Cast("google::protobuf::io::CodedInputStream*") Pointer input); public native void SerializeWithCachedSizes( @Cast("google::protobuf::io::CodedOutputStream*") Pointer output); public native @Cast("google::protobuf::uint8*") BytePointer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") BytePointer output); public native @Cast("google::protobuf::uint8*") ByteBuffer SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") ByteBuffer output); public native @Cast("google::protobuf::uint8*") byte[] SerializeWithCachedSizesToArray(@Cast("google::protobuf::uint8*") byte[] output); public native int GetCachedSize(); public native @ByVal @Cast("google::protobuf::Metadata*") Pointer GetMetadata(); // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // optional string name = 1; public native void clear_name(); @MemberGetter public static native int kNameFieldNumber(); public static final int kNameFieldNumber = kNameFieldNumber(); public native @StdString BytePointer name(); public native void set_name(@StdString BytePointer value); public native void set_name(@StdString String value); public native void set_name(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_name(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_name(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_name(); public native void set_allocated_name(@StdString @Cast({"char*", "std::string*"}) BytePointer name); // optional string op = 2; public native void clear_op(); @MemberGetter public static native int kOpFieldNumber(); public static final int kOpFieldNumber = kOpFieldNumber(); public native @StdString BytePointer op(); public native void set_op(@StdString BytePointer value); public native void set_op(@StdString String value); public native void set_op(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_op(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_op(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_op(); public native void set_allocated_op(@StdString @Cast({"char*", "std::string*"}) BytePointer op); // repeated string input = 3; public native int input_size(); public native void clear_input(); @MemberGetter public static native int kInputFieldNumber(); public static final int kInputFieldNumber = kInputFieldNumber(); public native @StdString BytePointer input(int index); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_input(int index); public native void set_input(int index, @StdString BytePointer value); public native void set_input(int index, @StdString String value); public native void set_input(int index, @Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_input(int index, String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer add_input(); public native void add_input(@StdString BytePointer value); public native void add_input(@StdString String value); public native void add_input(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void add_input(String value, @Cast("size_t") long size); // optional string device = 4; public native void clear_device(); @MemberGetter public static native int kDeviceFieldNumber(); public static final int kDeviceFieldNumber = kDeviceFieldNumber(); public native @StdString BytePointer device(); public native void set_device(@StdString BytePointer value); public native void set_device(@StdString String value); public native void set_device(@Cast("const char*") BytePointer value, @Cast("size_t") long size); public native void set_device(String value, @Cast("size_t") long size); public native @StdString @Cast({"char*", "std::string*"}) BytePointer mutable_device(); public native @StdString @Cast({"char*", "std::string*"}) BytePointer release_device(); public native void set_allocated_device(@StdString @Cast({"char*", "std::string*"}) BytePointer device); // map attr = 5; public native int attr_size(); public native void clear_attr(); @MemberGetter public static native int kAttrFieldNumber(); public static final int kAttrFieldNumber = kAttrFieldNumber(); public native @Const @ByRef StringAttrValueMap attr(); public native StringAttrValueMap mutable_attr(); } // =================================================================== // =================================================================== // #if !PROTOBUF_INLINE_NOT_IN_HEADERS // GraphDef // repeated .tensorflow.NodeDef node = 1; // optional .tensorflow.VersionDef versions = 4; // optional int32 version = 3 [deprecated = true]; // optional .tensorflow.FunctionDefLibrary library = 2; // ------------------------------------------------------------------- // NodeDef // optional string name = 1; // optional string op = 2; // repeated string input = 3; // optional string device = 4; // map attr = 5; // #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS // ------------------------------------------------------------------- // @@protoc_insertion_point(namespace_scope) // namespace tensorflow // @@protoc_insertion_point(global_scope) // #endif // PROTOBUF_tensorflow_2fcore_2fframework_2fgraph_2eproto__INCLUDED // Parsed from tensorflow/core/public/session.h /* Copyright 2015 Google Inc. 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_PUBLIC_SESSION_H_ // #define TENSORFLOW_PUBLIC_SESSION_H_ // #include // #include // #include "tensorflow/core/framework/graph.pb.h" // #include "tensorflow/core/framework/tensor.h" // #include "tensorflow/core/lib/core/status.h" // #include "tensorflow/core/platform/env.h" // #include "tensorflow/core/protobuf/config.pb.h" // #include "tensorflow/core/public/session_options.h" /** \brief A Session instance lets a caller drive a TensorFlow graph * computation. * * When a Session is created with a given target, a new Session object * is bound to the universe of resources specified by that target. * Those resources are available to this session to perform * computation described in the GraphDef. After extending the session * with a graph, the caller uses the Run() API to perform the * computation and potentially fetch outputs as Tensors. * * Example: * *

{@code c++
 * 
 *      tensorflow::GraphDef graph;
 *      // ... Create or load graph into "graph".
 * 
 *      // This example uses the default options which connects
 *      // to a local runtime.
 *      tensorflow::SessionOptions options;
 *      std::unique_ptr
 *      session(tensorflow::NewSession(options));
 * 
 *      // Create the session with this graph.
 *      tensorflow::Status s = session->Create(graph);
 *      if (!s.ok()) { ... }
 * 
 *      // Run the graph and fetch the first output of the "output"
 *      // operation, and also run to but do not return anything
 *      // for the "update_state" operation.
 *      std::vector outputs;
 *      s = session->Run({}, {"output:0"}, {"update_state"}, &outputs);
 *      if (!s.ok()) { ... }
 * 
 *      // Map the output as a flattened float tensor, and do something
 *      // with it.
 *      auto output_tensor = outputs[0].flat();
 *      if (output_tensor(0) > 0.5) { ... }
 * 
 *      // Close the session to release the resources associated with
 *      // this session.
 *      session->Close();
 * 
 *  }
* * A Session allows concurrent calls to Run(), though a Session must * be created / extended by a single thread. * * Only one thread must call Close(), and Close() must only be called * after all other calls to Run() have returned. */ @Namespace("tensorflow") public static class Session extends AbstractSession { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public Session(Pointer p) { super(p); } /// /** Calls {@link tensorflow#NewSession(SessionOptions)} and registers a deallocator. */ public Session(SessionOptions options) { super(options); } /** \brief Create the graph to be used for the session. * * Returns an error if this session has already been created with a * graph. To re-use the session with a different graph, the caller * must Close() the session first. */ /// public native @ByVal Status Create(@Const @ByRef GraphDef graph); /** \brief Adds operations to the graph that is already registered with the * Session. * * The names of new operations in "graph" must not exist in the * graph that is already registered. */ /// /// /// /// public native @ByVal Status Extend(@Const @ByRef GraphDef graph); /** \brief Runs the graph with the provided input tensors and fills * {@code outputs} for the endpoints specified in {@code output_tensor_names}. * Runs to but does not return Tensors for the nodes in * {@code target_node_names}. * * The order of tensors in {@code outputs} will match the order provided * by {@code output_tensor_names}. * * If {@code Run} returns {@code OK()}, then {@code outputs->size()} will be equal to * {@code output_tensor_names.size()}. If {@code Run} does not return {@code OK()}, the * state of {@code outputs} is undefined. * * REQUIRES: The name of each Tensor of the input or output must * match a "Tensor endpoint" in the {@code GraphDef} passed to {@code Create()}. * * REQUIRES: outputs is not nullptr if {@code output_tensor_names} is non-empty. */ public native @ByVal Status Run(@Const @ByRef StringTensorPairVector inputs, @Const @ByRef StringVector output_tensor_names, @Const @ByRef StringVector target_node_names, TensorVector outputs); /** \brief Implementations which support {@code RunOptions}. */ // /** NOTE: This API is still experimental and may change. */ public native @ByVal Status Create(@Const @ByRef RunOptions run_options, @Const @ByRef GraphDef graph); public native @ByVal Status Extend(@Const @ByRef RunOptions run_options, @Const @ByRef GraphDef graph); public native @ByVal Status Close(@Const @ByRef RunOptions run_options); /** \brief Like {@code Run}, but allows users to pass in a {@code RunOptions} proto and * to retrieve non-Tensor metadata output via a {@code RunMetadata} proto for this * step. {@code run_metadata} may be nullptr, in which case any metadata output is * discarded. * NOTE: This API is still experimental and may change. */ public native @ByVal Status Run(@Const @ByRef RunOptions run_options, @Const @ByRef StringTensorPairVector inputs, @Const @ByRef StringVector output_tensor_names, @Const @ByRef StringVector target_node_names, TensorVector outputs, RunMetadata run_metadata); /** \brief Sets up a graph for partial execution. All future feeds and * fetches are specified by {@code input_names} and {@code output_names}. Returns * {@code handle} that can be used to perform a sequence of partial feeds and * fetches. * NOTE: This API is still experimental and may change. */ public native @ByVal Status PRunSetup(@Const @ByRef StringVector input_names, @Const @ByRef StringVector output_names, @Const @ByRef StringVector target_nodes, @StdString @Cast({"char*", "std::string*"}) BytePointer handle); /** \brief Continues the pending execution specified by {@code handle} with the * provided input tensors and fills {@code outputs} for the endpoints specified * in {@code output_names}. * NOTE: This API is still experimental and may change. */ /// public native @ByVal Status PRun(@StdString BytePointer handle, @Const @ByRef StringTensorPairVector inputs, @Const @ByRef StringVector output_names, TensorVector outputs); public native @ByVal Status PRun(@StdString String handle, @Const @ByRef StringTensorPairVector inputs, @Const @ByRef StringVector output_names, TensorVector outputs); /** \brief Closes this session. * * Closing a session releases the resources used by this session * on the TensorFlow runtime (specified during session creation by * the {@code SessionOptions::target} field). */ public native @ByVal Status Close(); } /** \brief Create a new session with the given options. * * If a new {@code Session} object could not be created, this function will * return nullptr. */ /// @Namespace("tensorflow") public static native Session NewSession(@Const @ByRef SessionOptions options); /** \brief Create a new session with the given options. * * If session creation succeeds, the new {@code Session} will be stored in * {@code *out_session}, the caller will take ownership of the returned * {@code *out_session}, and this function will return {@code OK()}. Otherwise, this * function will return an error status. */ @Namespace("tensorflow") public static native @ByVal Status NewSession(@Const @ByRef SessionOptions options, @Cast("tensorflow::Session**") PointerPointer out_session); @Namespace("tensorflow") public static native @ByVal Status NewSession(@Const @ByRef SessionOptions options, @ByPtrPtr Session out_session); // end namespace tensorflow // #endif // TENSORFLOW_PUBLIC_SESSION_H_ // Parsed from tensorflow/core/public/tensor_c_api.h /* Copyright 2015 Google Inc. 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. ==============================================================================*/ // TODO(jeff,sanjay): Rename to tensorflow/public/c_api.h // #ifndef TENSORFLOW_PUBLIC_TENSOR_C_API_H_ // #define TENSORFLOW_PUBLIC_TENSOR_C_API_H_ // #include // -------------------------------------------------------------------------- // C API for TensorFlow. // // The API leans towards simplicity and uniformity instead of convenience // since most usage will be by language specific wrappers. // // Conventions: // * We use the prefix TF_ for everything in the API. // * Objects are always passed around as pointers to opaque structs // and these structs are allocated/deallocated via the API. // * TF_Status holds error information. It is an object type // and therefore is passed around as a pointer to an opaque // struct as mentioned above. // * Every call that has a TF_Status* argument clears it on success // and fills it with error info on failure. // // Questions left to address: // * Might need to add stride info to TF_Tensor? // * Might at some point need a way for callers to provide their own Env. // * Should we remove the TF_Status arg from TF_AddProto calls and only // report errors later (e.g., on Run call). // * Should dimensions be unsigned instead of signed? // * Maybe add TF_TensorShape that encapsulates dimension info. // // Design decisions made: // * Backing store for tensor memory has an associated deallocation // function. This deallocation function will point to client code // for tensors populated by the client. So the client can do things // like shadowing a numpy array. // * We do not provide TF_OK since it is not strictly necessary and we // are not optimizing for convenience. // * We make assumption that one session has one graph. This should be // fine since we have the ability to run sub-graphs. // * We are not providing TF_AddNode/TF_AddNodes to better support // languages/platforms where proto is not available. This is because // we can just point authors of bindings at the .proto file and the // proto serialization spec and they can do the right thing for // their language. // * We could allow NULL for some arguments (e.g., NULL options arg). // However since convenience is not a primary goal, we don't do this. // * Devices are not in this API. Instead, they are created/used internally // and the API just provides high level controls over the number of // devices of each type. // #ifdef __cplusplus // #endif // -------------------------------------------------------------------------- // TF_DataType holds the type for a scalar value. E.g., one slot in a tensor. // The enum values here are identical to corresponding values in types.proto. /** enum TF_DataType */ public static final int TF_FLOAT = 1, TF_DOUBLE = 2, TF_INT32 = 3, // Int32 tensors are always in 'host' memory. TF_UINT8 = 4, TF_INT16 = 5, TF_INT8 = 6, TF_STRING = 7, TF_COMPLEX64 = 8, // Single-precision complex TF_COMPLEX = 8, // Old identifier kept for API backwards compatibility TF_INT64 = 9, TF_BOOL = 10, TF_QINT8 = 11, // Quantized int8 TF_QUINT8 = 12, // Quantized uint8 TF_QINT32 = 13, // Quantized int32 TF_BFLOAT16 = 14, // Float32 truncated to 16 bits. Only for cast ops. TF_QINT16 = 15, // Quantized int16 TF_QUINT16 = 16, // Quantized uint16 TF_UINT16 = 17, TF_COMPLEX128 = 18, // Double-precision complex TF_HALF = 19; // -------------------------------------------------------------------------- // TF_Code holds an error code. The enum values here are identical to // corresponding values in error_codes.proto. /** enum TF_Code */ public static final int TF_OK = 0, TF_CANCELLED = 1, TF_UNKNOWN = 2, TF_INVALID_ARGUMENT = 3, TF_DEADLINE_EXCEEDED = 4, TF_NOT_FOUND = 5, TF_ALREADY_EXISTS = 6, TF_PERMISSION_DENIED = 7, TF_UNAUTHENTICATED = 16, TF_RESOURCE_EXHAUSTED = 8, TF_FAILED_PRECONDITION = 9, TF_ABORTED = 10, TF_OUT_OF_RANGE = 11, TF_UNIMPLEMENTED = 12, TF_INTERNAL = 13, TF_UNAVAILABLE = 14, TF_DATA_LOSS = 15; // -------------------------------------------------------------------------- // TF_Status holds error information. It either has an OK code, or // else an error code with an associated error message. @Opaque public static class TF_Status extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_Status() { super((Pointer)null); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public TF_Status(Pointer p) { super(p); } } // -------------------------------------------------------------------------- // TF_Buffer holds a pointer to a block of data and its associated length. // Typically, the data consists of a serialized protocol buffer, but other data // may also be held in a buffer. // // By default, TF_Buffer itself does not do any memory management of the // pointed-to block. If need be, users of this struct should specify how to // deallocate the block by setting the `data_deallocator` function pointer. public static class TF_Buffer extends Pointer { static { Loader.load(); } /** Default native constructor. */ public TF_Buffer() { super((Pointer)null); allocate(); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public TF_Buffer(long size) { super((Pointer)null); allocateArray(size); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public TF_Buffer(Pointer p) { super(p); } private native void allocate(); private native void allocateArray(long size); @Override public TF_Buffer position(long position) { return (TF_Buffer)super.position(position); } @MemberGetter public native @Const Pointer data(); public native @Cast("size_t") long length(); public native TF_Buffer length(long length); public static class Data_deallocator_Pointer_long extends FunctionPointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public Data_deallocator_Pointer_long(Pointer p) { super(p); } protected Data_deallocator_Pointer_long() { allocate(); } private native void allocate(); public native void call(Pointer data, @Cast("size_t") long length); } public native Data_deallocator_Pointer_long data_deallocator(); public native TF_Buffer data_deallocator(Data_deallocator_Pointer_long data_deallocator); } // Makes a copy of the input and sets an appropriate deallocator. Useful for // passing in read-only, input protobufs. public static native TF_Buffer TF_NewBufferFromString(@Const Pointer proto, @Cast("size_t") long proto_len); // Useful for passing *out* a protobuf. public static native TF_Buffer TF_NewBuffer(); public static native void TF_DeleteBuffer(TF_Buffer arg0); public static native @ByVal TF_Buffer TF_GetBuffer(TF_Buffer buffer); // -------------------------------------------------------------------------- // TF_Library holds information about dynamically loaded TensorFlow plugins. @Opaque public static class TF_Library extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_Library() { super((Pointer)null); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public TF_Library(Pointer p) { super(p); } } // Return a new status object. public static native TF_Status TF_NewStatus(); // Delete a previously created status object. public static native void TF_DeleteStatus(TF_Status arg0); // Record in *s. Any previous information is lost. // A common use is to clear a status: TF_SetStatus(s, TF_OK, ""); public static native void TF_SetStatus(TF_Status s, @Cast("TF_Code") int code, @Cast("const char*") BytePointer msg); public static native void TF_SetStatus(TF_Status s, @Cast("TF_Code") int code, String msg); // Return the code record in *s. public static native @Cast("TF_Code") int TF_GetCode(@Const TF_Status s); // Return a pointer to the error message in *s. The return value // points to memory that is only usable until the next mutation to *s. // Always returns an empty string if TF_GetCode(s) is TF_OK. public static native @Cast("const char*") BytePointer TF_Message(@Const TF_Status s); // -------------------------------------------------------------------------- // TF_Tensor holds a multi-dimensional array of elements of a single data type. // For all types other than TF_STRING, the data buffer stores elements // in row major order. E.g. if data is treated as a vector of TF_DataType: // // element 0: index (0, ..., 0) // element 1: index (0, ..., 1) // ... // // TODO(jeff,sanjay): Define format for TF_STRING tensors. Perhaps: // start_offset: array[uint64] // data: byte[...] // // String length is encoded (varint?) starting at data[start_offset[i]] // String contents follow immediately after string length. @Opaque public static class TF_Tensor extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_Tensor() { super((Pointer)null); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public TF_Tensor(Pointer p) { super(p); } } // Return a new tensor that holds the bytes data[0,len-1]. // // The data will be deallocated by a subsequent call to TF_DeleteTensor via: // (*deallocator)(data, len, deallocator_arg) // Clients must provide a custom deallocator function so they can pass in // memory managed by something like numpy. public static class Deallocator_Pointer_long_Pointer extends FunctionPointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public Deallocator_Pointer_long_Pointer(Pointer p) { super(p); } protected Deallocator_Pointer_long_Pointer() { allocate(); } private native void allocate(); public native void call(Pointer data, @Cast("size_t") long len, Pointer arg); } public static native TF_Tensor TF_NewTensor(@Cast("TF_DataType") int arg0, @Cast("long long*") LongPointer dims, int num_dims, Pointer data, @Cast("size_t") long len, Deallocator_Pointer_long_Pointer deallocator, Pointer deallocator_arg); public static native TF_Tensor TF_NewTensor(@Cast("TF_DataType") int arg0, @Cast("long long*") LongBuffer dims, int num_dims, Pointer data, @Cast("size_t") long len, Deallocator_Pointer_long_Pointer deallocator, Pointer deallocator_arg); public static native TF_Tensor TF_NewTensor(@Cast("TF_DataType") int arg0, @Cast("long long*") long[] dims, int num_dims, Pointer data, @Cast("size_t") long len, Deallocator_Pointer_long_Pointer deallocator, Pointer deallocator_arg); // Destroy a tensor. public static native void TF_DeleteTensor(TF_Tensor arg0); // Return the type of a tensor element. public static native @Cast("TF_DataType") int TF_TensorType(@Const TF_Tensor arg0); // Return the number of dimensions that the tensor has. public static native int TF_NumDims(@Const TF_Tensor arg0); // Return the length of the tensor in the "dim_index" dimension. // REQUIRES: 0 <= dim_index < TF_NumDims(tensor) public static native @Cast("long long") long TF_Dim(@Const TF_Tensor tensor, int dim_index); // Return the size of the underlying data in bytes. public static native @Cast("size_t") long TF_TensorByteSize(@Const TF_Tensor arg0); // Return a pointer to the underlying data buffer. public static native Pointer TF_TensorData(@Const TF_Tensor arg0); // -------------------------------------------------------------------------- // TF_SessionOptions holds options that can be passed during session creation. @Opaque public static class TF_SessionOptions extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_SessionOptions() { super((Pointer)null); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public TF_SessionOptions(Pointer p) { super(p); } } // Return a new options object. public static native TF_SessionOptions TF_NewSessionOptions(); // Set the target in TF_SessionOptions.options. // target can be empty, a single entry, or a comma separated list of entries. // Each entry is in one of the following formats : // "local" // ip:port // host:port public static native void TF_SetTarget(TF_SessionOptions options, @Cast("const char*") BytePointer target); public static native void TF_SetTarget(TF_SessionOptions options, String target); // Set the config in TF_SessionOptions.options. // config should be a serialized brain.ConfigProto proto. // If config was not parsed successfully as a ConfigProto, record the // error information in *status. public static native void TF_SetConfig(TF_SessionOptions options, @Const Pointer proto, @Cast("size_t") long proto_len, TF_Status status); // Destroy an options object. public static native void TF_DeleteSessionOptions(TF_SessionOptions arg0); // TODO(jeff,sanjay): // - export functions to set Config fields // -------------------------------------------------------------------------- // TF_Session manages a single graph and execution. @Opaque public static class TF_Session extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_Session() { super((Pointer)null); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public TF_Session(Pointer p) { super(p); } } // Return a new execution session, or NULL on error. public static native TF_Session TF_NewSession(@Const TF_SessionOptions arg0, TF_Status status); // Close a session. public static native void TF_CloseSession(TF_Session arg0, TF_Status status); // Destroy a session. Even if error information is recorded in *status, // this call discards all resources associated with the session. public static native void TF_DeleteSession(TF_Session arg0, TF_Status status); // Treat the bytes proto[0,proto_len-1] as a serialized GraphDef and // add the nodes in that GraphDef to the graph for the session. public static native void TF_ExtendGraph(TF_Session arg0, @Const Pointer proto, @Cast("size_t") long proto_len, TF_Status arg3); // Run the graph associated with the session starting with the // supplied inputs (inputs[0,ninputs-1]). Regardless of success or // failure, inputs[] become the property of the implementation (the // implementation will eventually call TF_DeleteTensor on each input). // // Any NULL and non-NULL value combinations for (`run_options`, // `run_metadata`) are valid. // // - `run_options` may be NULL, in which case it will be ignored; or // non-NULL, in which case it must point to a `TF_Buffer` containing the // serialized representation of a `RunOptions` protocol buffer. // - `run_metadata` may be NULL, in which case it will be ignored; or // non-NULL, in which case it must point to an empty, freshly allocated // `TF_Buffer` that may be updated to contain the serialized representation // of a `RunMetadata` protocol buffer. // // The caller retains the ownership of `run_options` and/or `run_metadata` (when // not NULL) and should manually call TF_DeleteBuffer on them. // // On success, the tensors corresponding to output_names[0,noutputs-1] // are placed in outputs[], and these outputs[] become the property // of the caller (the caller must eventually call TF_DeleteTensor on // them). // // On failure, outputs[] contains NULLs. public static native void TF_Run(TF_Session arg0, @Const TF_Buffer run_options, @Cast("const char**") PointerPointer input_names, @Cast("TF_Tensor**") PointerPointer inputs, int ninputs, @Cast("const char**") PointerPointer output_tensor_names, @Cast("TF_Tensor**") PointerPointer outputs, int noutputs, @Cast("const char**") PointerPointer target_node_names, int ntargets, TF_Buffer run_metadata, TF_Status arg11); public static native void TF_Run(TF_Session arg0, @Const TF_Buffer run_options, @Cast("const char**") @ByPtrPtr BytePointer input_names, @ByPtrPtr TF_Tensor inputs, int ninputs, @Cast("const char**") @ByPtrPtr BytePointer output_tensor_names, @ByPtrPtr TF_Tensor outputs, int noutputs, @Cast("const char**") @ByPtrPtr BytePointer target_node_names, int ntargets, TF_Buffer run_metadata, TF_Status arg11); public static native void TF_Run(TF_Session arg0, @Const TF_Buffer run_options, @Cast("const char**") @ByPtrPtr ByteBuffer input_names, @ByPtrPtr TF_Tensor inputs, int ninputs, @Cast("const char**") @ByPtrPtr ByteBuffer output_tensor_names, @ByPtrPtr TF_Tensor outputs, int noutputs, @Cast("const char**") @ByPtrPtr ByteBuffer target_node_names, int ntargets, TF_Buffer run_metadata, TF_Status arg11); public static native void TF_Run(TF_Session arg0, @Const TF_Buffer run_options, @Cast("const char**") @ByPtrPtr byte[] input_names, @ByPtrPtr TF_Tensor inputs, int ninputs, @Cast("const char**") @ByPtrPtr byte[] output_tensor_names, @ByPtrPtr TF_Tensor outputs, int noutputs, @Cast("const char**") @ByPtrPtr byte[] target_node_names, int ntargets, TF_Buffer run_metadata, TF_Status arg11); // Set up the graph with the intended feeds and fetches for a sequence // of partial run calls. // // On success, returns a handle that is used for subsequent PRun calls. // // On failure, out_status contains a tensorflow::Status with an error // message. // NOTE: This is EXPERIMENTAL and subject to change. public static native void TF_PRunSetup(TF_Session arg0, @Cast("const char**") PointerPointer input_names, int ninputs, @Cast("const char**") PointerPointer output_tensor_names, int noutputs, @Cast("const char**") PointerPointer target_node_names, int ntargets, @Cast("char**") PointerPointer handle, TF_Status arg8); public static native void TF_PRunSetup(TF_Session arg0, @Cast("const char**") @ByPtrPtr BytePointer input_names, int ninputs, @Cast("const char**") @ByPtrPtr BytePointer output_tensor_names, int noutputs, @Cast("const char**") @ByPtrPtr BytePointer target_node_names, int ntargets, @Cast("char**") @ByPtrPtr BytePointer handle, TF_Status arg8); public static native void TF_PRunSetup(TF_Session arg0, @Cast("const char**") @ByPtrPtr ByteBuffer input_names, int ninputs, @Cast("const char**") @ByPtrPtr ByteBuffer output_tensor_names, int noutputs, @Cast("const char**") @ByPtrPtr ByteBuffer target_node_names, int ntargets, @Cast("char**") @ByPtrPtr ByteBuffer handle, TF_Status arg8); public static native void TF_PRunSetup(TF_Session arg0, @Cast("const char**") @ByPtrPtr byte[] input_names, int ninputs, @Cast("const char**") @ByPtrPtr byte[] output_tensor_names, int noutputs, @Cast("const char**") @ByPtrPtr byte[] target_node_names, int ntargets, @Cast("char**") @ByPtrPtr byte[] handle, TF_Status arg8); // Continue to run the graph with additional feeds and fetches. The // execution state is uniquely identified by the handle. // NOTE: This is EXPERIMENTAL and subject to change. public static native void TF_PRun(TF_Session arg0, @Cast("const char*") BytePointer handle, @Cast("const char**") PointerPointer input_names, @Cast("TF_Tensor**") PointerPointer inputs, int ninputs, @Cast("const char**") PointerPointer output_tensor_names, @Cast("TF_Tensor**") PointerPointer outputs, int noutputs, @Cast("const char**") PointerPointer target_node_names, int ntargets, TF_Status arg10); public static native void TF_PRun(TF_Session arg0, @Cast("const char*") BytePointer handle, @Cast("const char**") @ByPtrPtr BytePointer input_names, @ByPtrPtr TF_Tensor inputs, int ninputs, @Cast("const char**") @ByPtrPtr BytePointer output_tensor_names, @ByPtrPtr TF_Tensor outputs, int noutputs, @Cast("const char**") @ByPtrPtr BytePointer target_node_names, int ntargets, TF_Status arg10); public static native void TF_PRun(TF_Session arg0, String handle, @Cast("const char**") @ByPtrPtr ByteBuffer input_names, @ByPtrPtr TF_Tensor inputs, int ninputs, @Cast("const char**") @ByPtrPtr ByteBuffer output_tensor_names, @ByPtrPtr TF_Tensor outputs, int noutputs, @Cast("const char**") @ByPtrPtr ByteBuffer target_node_names, int ntargets, TF_Status arg10); public static native void TF_PRun(TF_Session arg0, @Cast("const char*") BytePointer handle, @Cast("const char**") @ByPtrPtr byte[] input_names, @ByPtrPtr TF_Tensor inputs, int ninputs, @Cast("const char**") @ByPtrPtr byte[] output_tensor_names, @ByPtrPtr TF_Tensor outputs, int noutputs, @Cast("const char**") @ByPtrPtr byte[] target_node_names, int ntargets, TF_Status arg10); public static native void TF_PRun(TF_Session arg0, String handle, @Cast("const char**") @ByPtrPtr BytePointer input_names, @ByPtrPtr TF_Tensor inputs, int ninputs, @Cast("const char**") @ByPtrPtr BytePointer output_tensor_names, @ByPtrPtr TF_Tensor outputs, int noutputs, @Cast("const char**") @ByPtrPtr BytePointer target_node_names, int ntargets, TF_Status arg10); public static native void TF_PRun(TF_Session arg0, @Cast("const char*") BytePointer handle, @Cast("const char**") @ByPtrPtr ByteBuffer input_names, @ByPtrPtr TF_Tensor inputs, int ninputs, @Cast("const char**") @ByPtrPtr ByteBuffer output_tensor_names, @ByPtrPtr TF_Tensor outputs, int noutputs, @Cast("const char**") @ByPtrPtr ByteBuffer target_node_names, int ntargets, TF_Status arg10); public static native void TF_PRun(TF_Session arg0, String handle, @Cast("const char**") @ByPtrPtr byte[] input_names, @ByPtrPtr TF_Tensor inputs, int ninputs, @Cast("const char**") @ByPtrPtr byte[] output_tensor_names, @ByPtrPtr TF_Tensor outputs, int noutputs, @Cast("const char**") @ByPtrPtr byte[] target_node_names, int ntargets, TF_Status arg10); // -------------------------------------------------------------------------- // Load plugins containing custom ops and kernels // Load the library specified by library_filename and register the ops and // kernels present in that library. // // Pass "library_filename" to a platform-specific mechanism for dynamically // loading a library. The rules for determining the exact location of the // library are platform-specific and are not documented here. // Expects the symbols "RegisterOps", "RegisterKernels", and "GetOpList", to be // defined in the library. // // On success, place OK in status and return the newly created library handle. // The caller owns the library handle. // // On failure, place an error status in status and return NULL. public static native TF_Library TF_LoadLibrary(@Cast("const char*") BytePointer library_filename, TF_Status status); public static native TF_Library TF_LoadLibrary(String library_filename, TF_Status status); // Get the OpList of OpDefs defined in the library pointed by lib_handle. // // Returns a TF_Buffer. The memory pointed to by the result is owned by // lib_handle. The data in the buffer will be the serialized OpList proto for // ops defined in the library. public static native @ByVal TF_Buffer TF_GetOpList(TF_Library lib_handle); // #ifdef __cplusplus /* end extern "C" */ // #endif // #endif // TENSORFLOW_PUBLIC_TENSOR_C_API_H_ // Parsed from tensorflow/core/framework/op_def_builder.h /* Copyright 2015 Google Inc. 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. ==============================================================================*/ // Class and associated machinery for specifying an Op's OpDef for Op // registration. // #ifndef TENSORFLOW_FRAMEWORK_OP_DEF_BUILDER_H_ // #define TENSORFLOW_FRAMEWORK_OP_DEF_BUILDER_H_ // #include // #include // #include "tensorflow/core/framework/op_def.pb.h" // #include "tensorflow/core/lib/core/status.h" // #include "tensorflow/core/lib/core/stringpiece.h" // Builder class passed to the REGISTER_OP() macro. @Namespace("tensorflow") @NoOffset public static class OpDefBuilder extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public OpDefBuilder(Pointer p) { super(p); } // Constructs an OpDef with just the name field set. public OpDefBuilder(@StringPiece BytePointer op_name) { super((Pointer)null); allocate(op_name); } private native void allocate(@StringPiece BytePointer op_name); public OpDefBuilder(@StringPiece String op_name) { super((Pointer)null); allocate(op_name); } private native void allocate(@StringPiece String op_name); // Adds an attr to this OpDefBuilder (and returns *this). The spec has // format ":" or ":=" // where matches regexp [a-zA-Z][a-zA-Z0-9_]* // (by convention only using capital letters for attrs that can be inferred) // can be: // "string", "int", "float", "bool", "type", "shape", or "tensor" // "numbertype", "realnumbertype", "quantizedtype", "{int32,int64}" // (meaning "type" with a restriction on valid values) // "{\"foo\", \"bar\n baz\"}", or "{'foo', 'bar\n baz'}" // (meaning "string" with a restriction on valid values) // "list(string)", ..., "list(tensor)", "list(numbertype)", ... // (meaning lists of the above types) // "int >= 2" (meaning "int" with a restriction on valid values) // "list(string) >= 2", "list(int) >= 2" // (meaning "list(string)" / "list(int)" with length at least 2) // , if included, should use the Proto text format // of . For lists use [a, b, c] format. // // Note that any attr specifying the length of an input or output will // get a default minimum of 1 unless the >= # syntax is used. // // TODO(josh11b): Perhaps support restrictions and defaults as optional // extra arguments to Attr() instead of encoding them in the spec string. // TODO(josh11b): Would like to have better dtype handling for tensor attrs: // * Ability to say the type of an input/output matches the type of // the tensor. // * Ability to restrict the type of the tensor like the existing // restrictions for type attrs. // Perhaps by linking the type of the tensor to a type attr? public native @ByRef OpDefBuilder Attr(@StringPiece BytePointer spec); public native @ByRef OpDefBuilder Attr(@StringPiece String spec); // Adds an input or output to this OpDefBuilder (and returns *this). // The spec has form ":" or ":Ref()" // where matches regexp [a-z][a-z0-9_]* and can be: // * For a single tensor: // * For a sequence of tensors with the same type: * // * For a sequence of tensors with different types: // Where: // is either one of "float", "int32", "string", ... // or the name of an attr (see above) with type "type". // is the name of an attr with type "int". // is the name of an attr with type "list(type)". // TODO(josh11b): Indicate Ref() via an optional argument instead of // in the spec? // TODO(josh11b): SparseInput() and SparseOutput() matching the Python // handling? public native @ByRef OpDefBuilder Input(@StringPiece BytePointer spec); public native @ByRef OpDefBuilder Input(@StringPiece String spec); public native @ByRef OpDefBuilder Output(@StringPiece BytePointer spec); public native @ByRef OpDefBuilder Output(@StringPiece String spec); // Turns on the indicated boolean flag in this OpDefBuilder (and // returns *this). public native @ByRef OpDefBuilder SetIsCommutative(); public native @ByRef OpDefBuilder SetIsAggregate(); public native @ByRef OpDefBuilder SetIsStateful(); public native @ByRef OpDefBuilder SetAllowsUninitializedInput(); // Adds docs to this OpDefBuilder (and returns *this). // Docs have the format: // <1-line summary> // // : // : // // Where is the name of an attr, input, or output. Please // wrap docs at 72 columns so that it may be indented in the // generated output. For tensor inputs or outputs (not attrs), you // may start the description with an "=" (like name:= ) // to suppress the automatically-generated type documentation in // generated output. // #ifndef TF_LEAN_BINARY public native @ByRef OpDefBuilder Doc(@StringPiece BytePointer text); public native @ByRef OpDefBuilder Doc(@StringPiece String text); // #else // #endif // Sets *op_def to the requested OpDef, or returns an error. // Must be called after all of the above methods. // Note that OpDefBuilder only reports parsing errors. You should also // call ValidateOpDef() to detect other problems. public native @ByVal Status Finalize(OpDef op_def); } // namespace tensorflow // #endif // TENSORFLOW_FRAMEWORK_OP_DEF_BUILDER_H_ // Parsed from tensorflow/core/framework/op_def_util.h /* Copyright 2015 Google Inc. 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. ==============================================================================*/ // TODO(josh11b): Probably not needed for OpKernel authors, so doesn't // need to be as publicly accessible as other files in framework/. // #ifndef TENSORFLOW_FRAMEWORK_OP_DEF_UTIL_H_ // #define TENSORFLOW_FRAMEWORK_OP_DEF_UTIL_H_ // #include // #include "tensorflow/core/framework/op_def.pb.h" // #include "tensorflow/core/lib/core/status.h" // Performs a consistency check across the fields of the op_def. @Namespace("tensorflow") public static native @ByVal Status ValidateOpDef(@Const @ByRef OpDef op_def); // Validates that attr_value satisfies the type and constraints from attr. // REQUIRES: attr has already been validated. @Namespace("tensorflow") public static native @ByVal Status ValidateAttrValue(@Const @ByRef AttrValue attr_value, @Cast("const tensorflow::OpDef::AttrDef*") @ByRef OpDef_AttrDef attr); // The following search through op_def for an attr with the indicated name. // Returns nullptr if no such attr is found. @Namespace("tensorflow") public static native @Cast("const tensorflow::OpDef::AttrDef*") OpDef_AttrDef FindAttr(@StringPiece BytePointer name, @Const @ByRef OpDef op_def); @Namespace("tensorflow") public static native @Cast("const tensorflow::OpDef::AttrDef*") OpDef_AttrDef FindAttr(@StringPiece String name, @Const @ByRef OpDef op_def); @Namespace("tensorflow") public static native @Cast("tensorflow::OpDef::AttrDef*") OpDef_AttrDef FindAttrMutable(@StringPiece BytePointer name, OpDef op_def); @Namespace("tensorflow") public static native @Cast("tensorflow::OpDef::AttrDef*") OpDef_AttrDef FindAttrMutable(@StringPiece String name, OpDef op_def); // Produce a human-readable version of an op_def that is more concise // than a text-format proto. Excludes descriptions. @Namespace("tensorflow") public static native @StdString BytePointer SummarizeOpDef(@Const @ByRef OpDef op_def); // Returns an error if new_op is not backwards-compatible with (more // accepting than) old_op. // REQUIRES: old_op and new_op must pass validation. @Namespace("tensorflow") public static native @ByVal Status OpDefCompatible(@Const @ByRef OpDef old_op, @Const @ByRef OpDef new_op); // Returns an error if any attr in penultimate_op that is not in old_op // has a different default value in new_op. In general it is not safe // to change the default for an attr that has been added to an op. @Namespace("tensorflow") public static native @ByVal Status OpDefAddedDefaultsUnchanged(@Const @ByRef OpDef old_op, @Const @ByRef OpDef penultimate_op, @Const @ByRef OpDef new_op); // Remove all docs from *op_def / *op_list. @Namespace("tensorflow") public static native void RemoveDescriptionsFromOpDef(OpDef op_def); @Namespace("tensorflow") public static native void RemoveDescriptionsFromOpList(OpList op_list); // namespace tensorflow // #endif // TENSORFLOW_FRAMEWORK_OP_DEF_UTIL_H_ // Parsed from tensorflow/core/framework/op.h /* Copyright 2015 Google Inc. 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_FRAMEWORK_OP_H_ // #define TENSORFLOW_FRAMEWORK_OP_H_ // #include // #include // #include // #include "tensorflow/core/framework/op_def.pb.h" // #include "tensorflow/core/framework/op_def_builder.h" // #include "tensorflow/core/framework/op_def_util.h" // #include "tensorflow/core/framework/selective_registration.h" // #include "tensorflow/core/lib/core/status.h" // #include "tensorflow/core/lib/strings/str_util.h" // #include "tensorflow/core/lib/strings/strcat.h" // #include "tensorflow/core/platform/logging.h" // #include "tensorflow/core/platform/macros.h" // #include "tensorflow/core/platform/mutex.h" // #include "tensorflow/core/platform/thread_annotations.h" // #include "tensorflow/core/platform/types.h" // Users that want to look up an OpDef by type name should take an // OpRegistryInterface. Functions accepting a // (const) OpRegistryInterface* may call LookUp() from multiple threads. @Namespace("tensorflow") public static class OpRegistryInterface extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public OpRegistryInterface(Pointer p) { super(p); } // Returns nullptr and sets *status if no OpDef is registered under that // name, otherwise returns the registered OpDef. // Caller must not delete the returned pointer. public native @Const OpDef LookUp(@StdString BytePointer op_type_name, Status status); public native @Const OpDef LookUp(@StdString String op_type_name, Status status); } // The standard implementation of OpRegistryInterface, along with a // global singleton used for registering OpDefs via the REGISTER // macros below. Thread-safe. // // Example registration: // OpRegistry::Global()->Register([]()->OpDef{ // OpDef def; // // Populate def here. // return def; // }); @Namespace("tensorflow") @NoOffset public static class OpRegistry extends OpRegistryInterface { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public OpRegistry(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public OpRegistry(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public OpRegistry position(long position) { return (OpRegistry)super.position(position); } public OpRegistry() { super((Pointer)null); allocate(); } private native void allocate(); // Calls func() and registers the returned OpDef. Since Register() // is normally called during program initialization (before main()), // we defer calling func() until the first call to LookUp() or // Export() (if one of those has already been called, func() is // called immediately). public native void Register(@Const @ByRef OpDef op_def); public native @Const OpDef LookUp(@StdString BytePointer op_type_name, Status status); public native @Const OpDef LookUp(@StdString String op_type_name, Status status); // Fills *ops with all registered OpDefs (except those with names // starting with '_' if include_internal == false). public native void Export(@Cast("bool") boolean include_internal, OpList ops); // Returns ASCII-format OpList for all registered OpDefs (except // those with names starting with '_' if include_internal == false). public native @StdString BytePointer DebugString(@Cast("bool") boolean include_internal); // A singleton available at startup. public static native OpRegistry Global(); // Get all registered ops. public native void GetRegisteredOps(@StdVector OpDef op_defs); // Watcher, a function object. // watcher_, if not null, is called every time an op is registered via the // Register function. watcher_ is passed the OpDef of the op getting // registered. // An OpRegistry object has only one watcher. This interface is not thread // safe, as different clients are free to set the watcher any time. // Clients are expected to atomically perform the following sequence of // operations : // SetWatcher(a_watcher); // Register some ops; // SetWatcher(nullptr); // Returns a non-OK status if a non-null watcher is over-written by another // non-null watcher. public native @ByVal Status SetWatcher(@Cast("const tensorflow::OpRegistry::Watcher*") @ByRef Fn watcher); } // An adapter to allow an OpList to be used as an OpRegistryInterface. @Namespace("tensorflow") @NoOffset public static class OpListOpRegistry extends OpRegistryInterface { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public OpListOpRegistry(Pointer p) { super(p); } // Does not take ownership of op_list, *op_list must outlive *this. public OpListOpRegistry(@Const OpList op_list) { super((Pointer)null); allocate(op_list); } private native void allocate(@Const OpList op_list); public native @Const OpDef LookUp(@StdString BytePointer op_type_name, Status status); public native @Const OpDef LookUp(@StdString String op_type_name, Status status); } // Treats 'registry_ptr' as a pointer to OpRegistry, and calls // registry_ptr->Register(op_def) for each op_def that has been registered with // the current library's global op registry (obtained by calling // OpRegistry::Global(). @Namespace("tensorflow") public static native void RegisterOps(Pointer registry_ptr); // Support for defining the OpDef (specifying the semantics of the Op and how // it should be created) and registering it in the OpRegistry::Global() // registry. Usage: // // REGISTER_OP("my_op_name") // .Attr(":") // .Attr(":=") // .Input(":") // .Input(":Ref()") // .Output(":") // .Doc(R"( // <1-line summary> // // : // : // )"); // // Note: .Doc() should be last. // For details, see the OpDefBuilder class in op_def_builder.h. // OpDefBuilderWrapper is a templated class that is used in the REGISTER_OP // calls. This allows the result of REGISTER_OP to be used in chaining, as in // REGISTER_OP(a).Attr("...").Input("...");, while still allowing selective // registration to turn the entire call-chain into a no-op. // Template specialization that forwards all calls to the contained builder. @Name("tensorflow::register_op::OpDefBuilderWrapper") @NoOffset public static class TrueOpDefBuilderWrapper extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public TrueOpDefBuilderWrapper(Pointer p) { super(p); } public TrueOpDefBuilderWrapper(@Cast("const char*") BytePointer name) { super((Pointer)null); allocate(name); } private native void allocate(@Cast("const char*") BytePointer name); public TrueOpDefBuilderWrapper(String name) { super((Pointer)null); allocate(name); } private native void allocate(String name); public native @ByRef TrueOpDefBuilderWrapper Attr(@StringPiece BytePointer spec); public native @ByRef TrueOpDefBuilderWrapper Attr(@StringPiece String spec); public native @ByRef TrueOpDefBuilderWrapper Input(@StringPiece BytePointer spec); public native @ByRef TrueOpDefBuilderWrapper Input(@StringPiece String spec); public native @ByRef TrueOpDefBuilderWrapper Output(@StringPiece BytePointer spec); public native @ByRef TrueOpDefBuilderWrapper Output(@StringPiece String spec); public native @ByRef TrueOpDefBuilderWrapper SetIsCommutative(); public native @ByRef TrueOpDefBuilderWrapper SetIsAggregate(); public native @ByRef TrueOpDefBuilderWrapper SetIsStateful(); public native @ByRef TrueOpDefBuilderWrapper SetAllowsUninitializedInput(); public native @ByRef TrueOpDefBuilderWrapper Doc(@StringPiece BytePointer text); public native @ByRef TrueOpDefBuilderWrapper Doc(@StringPiece String text); public native @Const @ByRef OpDefBuilder builder(); } // Template specialization that turns all calls into no-ops. @Name("tensorflow::register_op::OpDefBuilderWrapper") public static class FalseOpDefBuilderWrapper extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public FalseOpDefBuilderWrapper(Pointer p) { super(p); } public FalseOpDefBuilderWrapper(@Cast("const char*") BytePointer name) { super((Pointer)null); allocate(name); } private native void allocate(@Cast("const char*") BytePointer name); public FalseOpDefBuilderWrapper(String name) { super((Pointer)null); allocate(name); } private native void allocate(String name); public native @ByRef FalseOpDefBuilderWrapper Attr(@StringPiece BytePointer spec); public native @ByRef FalseOpDefBuilderWrapper Attr(@StringPiece String spec); public native @ByRef FalseOpDefBuilderWrapper Input(@StringPiece BytePointer spec); public native @ByRef FalseOpDefBuilderWrapper Input(@StringPiece String spec); public native @ByRef FalseOpDefBuilderWrapper Output(@StringPiece BytePointer spec); public native @ByRef FalseOpDefBuilderWrapper Output(@StringPiece String spec); public native @ByRef FalseOpDefBuilderWrapper SetIsCommutative(); public native @ByRef FalseOpDefBuilderWrapper SetIsAggregate(); public native @ByRef FalseOpDefBuilderWrapper SetIsStateful(); public native @ByRef FalseOpDefBuilderWrapper SetAllowsUninitializedInput(); public native @ByRef FalseOpDefBuilderWrapper Doc(@StringPiece BytePointer text); public native @ByRef FalseOpDefBuilderWrapper Doc(@StringPiece String text); } @Namespace("tensorflow::register_op") public static class OpDefBuilderReceiver extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public OpDefBuilderReceiver(Pointer p) { super(p); } // To call OpRegistry::Global()->Register(...), used by the // REGISTER_OP macro below. // Note: These are implicitly converting constructors. public OpDefBuilderReceiver( @Const @ByRef TrueOpDefBuilderWrapper wrapper) { super((Pointer)null); allocate(wrapper); } private native void allocate( @Const @ByRef TrueOpDefBuilderWrapper wrapper); // NOLINT(runtime/explicit) public OpDefBuilderReceiver(@Const @ByRef FalseOpDefBuilderWrapper arg0) { super((Pointer)null); allocate(arg0); } private native void allocate(@Const @ByRef FalseOpDefBuilderWrapper arg0); // NOLINT(runtime/explicit) } // namespace register_op // #define REGISTER_OP(name) REGISTER_OP_UNIQ_HELPER(__COUNTER__, name) // #define REGISTER_OP_UNIQ_HELPER(ctr, name) REGISTER_OP_UNIQ(ctr, name) // #define REGISTER_OP_UNIQ(ctr, name) // static ::tensorflow::register_op::OpDefBuilderReceiver register_op##ctr // TF_ATTRIBUTE_UNUSED = // ::tensorflow::register_op::OpDefBuilderWrapper(name) // namespace tensorflow // #endif // TENSORFLOW_FRAMEWORK_OP_H_ // Parsed from tensorflow/core/framework/types.h /* Copyright 2015 Google Inc. 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_FRAMEWORK_TYPES_H_ // #define TENSORFLOW_FRAMEWORK_TYPES_H_ // #include // #include // #include // #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" // Disable clang-format to prevent 'FixedPoint' header from being included // before 'Tensor' header on which it depends. // clang-format off // #include "third_party/eigen3/unsupported/Eigen/CXX11/FixedPoint" // clang-format on // #include "tensorflow/core/framework/bfloat16.h" // #include "tensorflow/core/framework/numeric_types.h" // #include "tensorflow/core/framework/types.pb.h" // #include "tensorflow/core/lib/core/stringpiece.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // #include "tensorflow/core/lib/gtl/inlined_vector.h" // #include "tensorflow/core/platform/logging.h" // #include "tensorflow/core/platform/types.h" // MemoryType is used to describe whether input or output Tensors of // an OpKernel should reside in "Host memory" (e.g., CPU memory) or // "Device" Memory (CPU memory for CPU devices, GPU memory for GPU // devices). /** enum tensorflow::MemoryType */ public static final int DEVICE_MEMORY = 0, HOST_MEMORY = 1; // A DeviceType is just a string, but we wrap it up in a class to give // some type checking as we're passing these around @Namespace("tensorflow") @NoOffset public static class DeviceType extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public DeviceType(Pointer p) { super(p); } public DeviceType(@Cast("const char*") BytePointer type) { super((Pointer)null); allocate(type); } private native void allocate(@Cast("const char*") BytePointer type); public DeviceType(String type) { super((Pointer)null); allocate(type); } private native void allocate(String type); public native @Cast("const char*") BytePointer type(); public native @Cast("bool") @Name("operator <") boolean lessThan(@Const @ByRef DeviceType other); public native @Cast("bool") @Name("operator ==") boolean equals(@Const @ByRef DeviceType other); public native @Cast("bool") @Name("operator !=") boolean notEquals(@Const @ByRef DeviceType other); } @Namespace("tensorflow") public static native @Cast("std::ostream*") @ByRef @Name("operator <<") Pointer shiftLeft(@Cast("std::ostream*") @ByRef Pointer os, @Const @ByRef DeviceType d); // Convenient constants that can be passed to a DeviceType constructor @Namespace("tensorflow") @MemberGetter public static native @Cast("const char*") BytePointer DEVICE_CPU(); // "CPU" @Namespace("tensorflow") @MemberGetter public static native @Cast("const char*") BytePointer DEVICE_GPU(); // "GPU" // Convert the enums to strings for errors: @Namespace("tensorflow") public static native @StdString BytePointer DataTypeString(@Cast("tensorflow::DataType") int dtype); @Namespace("tensorflow") public static native @StdString BytePointer DeviceTypeString(@ByVal DeviceType device_type); @Namespace("tensorflow") public static native @StdString BytePointer DataTypeSliceString(@Const @ByVal DataTypeVector dtypes); @Namespace("tensorflow") public static native @StdString BytePointer DataTypeVectorString(@Const @ByRef DataTypeVector dtypes); // If "sp" names a valid type, store it in "*dt" and return true. Otherwise, // return false. @Namespace("tensorflow") public static native @Cast("bool") boolean DataTypeFromString(@StringPiece BytePointer sp, @Cast("tensorflow::DataType*") IntPointer dt); @Namespace("tensorflow") public static native @Cast("bool") boolean DataTypeFromString(@StringPiece String sp, @Cast("tensorflow::DataType*") IntPointer dt); // DT_FLOAT + kDataTypeRefOffset == DT_FLOAT_REF, etc. /** enum tensorflow:: */ public static final int kDataTypeRefOffset = 100; @Namespace("tensorflow") public static native @Cast("bool") boolean IsRefType(@Cast("tensorflow::DataType") int dtype); @Namespace("tensorflow") public static native @Cast("tensorflow::DataType") int MakeRefType(@Cast("tensorflow::DataType") int dtype); @Namespace("tensorflow") public static native @Cast("tensorflow::DataType") int RemoveRefType(@Cast("tensorflow::DataType") int dtype); @Namespace("tensorflow") public static native @Cast("tensorflow::DataType") int BaseType(@Cast("tensorflow::DataType") int dtype); // Returns true if the actual type is the same as or ref of the expected type. @Namespace("tensorflow") public static native @Cast("bool") boolean TypesCompatible(@Cast("tensorflow::DataType") int expected, @Cast("tensorflow::DataType") int actual); // Does not include _ref types. @Namespace("tensorflow") public static native @ByVal DataTypeVector AllTypes(); // Return the list of all numeric types. // NOTE: On Android, we only include the float and int32 types for now. @Namespace("tensorflow") public static native @ByVal DataTypeVector RealNumberTypes(); // Types that support '<' and '>'. @Namespace("tensorflow") public static native @ByVal DataTypeVector NumberTypes(); // Includes complex and quantized types. @Namespace("tensorflow") public static native @ByVal DataTypeVector QuantizedTypes(); @Namespace("tensorflow") public static native @ByVal DataTypeVector RealAndQuantizedTypes(); // Types that support '<' and // '>', including quantized // types // Validates type T for whether it is a supported DataType. // DataTypeToEnum::v() and DataTypeToEnum::value are the DataType // constants for T, e.g. DataTypeToEnum::v() is DT_FLOAT. // Specializations below // EnumToDataType::Type is the type for DataType constant VALUE, e.g. // EnumToDataType::Type is float. // Specializations below // Template specialization for both DataTypeToEnum and EnumToDataType. // #define MATCH_TYPE_AND_ENUM(TYPE, ENUM) // template <> // struct DataTypeToEnum { // static DataType v() { return ENUM; } // static DataType ref() { return MakeRefType(ENUM); } // static constexpr DataType value = ENUM; // }; // template <> // struct IsValidDataType { // static constexpr bool value = true; // }; // template <> // struct EnumToDataType { // typedef TYPE Type; // } // We use Eigen's QInt implementations for our quantized int types. @Name("tensorflow::DataTypeToEnum") public static class DataTypeToEnum extends Pointer { static { Loader.load(); } /** Default native constructor. */ public DataTypeToEnum() { super((Pointer)null); allocate(); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public DataTypeToEnum(long size) { super((Pointer)null); allocateArray(size); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public DataTypeToEnum(Pointer p) { super(p); } private native void allocate(); private native void allocateArray(long size); @Override public DataTypeToEnum position(long position) { return (DataTypeToEnum)super.position(position); } public static native @Cast("tensorflow::DataType") int v(); public static native @Cast("tensorflow::DataType") int ref(); @MemberGetter public static native @Cast("const tensorflow::DataType") int value(); public static final int value = value(); } @Name("tensorflow::IsValidDataType") public static class IsValidDataType extends Pointer { static { Loader.load(); } /** Default native constructor. */ public IsValidDataType() { super((Pointer)null); allocate(); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public IsValidDataType(long size) { super((Pointer)null); allocateArray(size); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public IsValidDataType(Pointer p) { super(p); } private native void allocate(); private native void allocateArray(long size); @Override public IsValidDataType position(long position) { return (IsValidDataType)super.position(position); } @MemberGetter public static native @Cast("const bool") boolean value(); public static final boolean value = value(); } @Name("tensorflow::EnumToDataType") public static class EnumToDataType extends Pointer { static { Loader.load(); } /** Default native constructor. */ public EnumToDataType() { super((Pointer)null); allocate(); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public EnumToDataType(long size) { super((Pointer)null); allocateArray(size); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public EnumToDataType(Pointer p) { super(p); } private native void allocate(); private native void allocateArray(long size); @Override public EnumToDataType position(long position) { return (EnumToDataType)super.position(position); } } // #undef MATCH_TYPE_AND_ENUM @Namespace("tensorflow") public static native @Cast("bool") boolean DataTypeCanUseMemcpy(@Cast("tensorflow::DataType") int dt); @Namespace("tensorflow") public static native @Cast("bool") boolean DataTypeIsQuantized(@Cast("tensorflow::DataType") int dt); // Returns a 0 on failure @Namespace("tensorflow") public static native int DataTypeSize(@Cast("tensorflow::DataType") int dt); // namespace tensorflow // #endif // TENSORFLOW_FRAMEWORK_TYPES_H_ // Parsed from tensorflow/core/graph/edgeset.h /* Copyright 2015 Google Inc. 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_EDGESET_H_ // #define TENSORFLOW_GRAPH_EDGESET_H_ // #include // #include // #include "tensorflow/core/platform/macros.h" // #include "tensorflow/core/platform/types.h" // #include "tensorflow/core/platform/logging.h" // An unordered set of edges. Uses very little memory for small sets. // Unlike std::set, EdgeSet does NOT allow mutations during iteration. @Namespace("tensorflow") @NoOffset public static class EdgeSet extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public EdgeSet(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public EdgeSet(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public EdgeSet position(long position) { return (EdgeSet)super.position(position); } public EdgeSet() { super((Pointer)null); allocate(); } private native void allocate(); @Name("const_iterator") @Opaque public static class EdgeSetIterator extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public EdgeSetIterator() { super((Pointer)null); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public EdgeSetIterator(Pointer p) { super(p); } } public native @Cast("bool") boolean empty(); public native @Cast("tensorflow::EdgeSet::size_type") long size(); public native void clear(); public native @ByVal EdgeSetBoolPair insert(@Cast("tensorflow::EdgeSet::value_type") Edge value); public native @Cast("tensorflow::EdgeSet::size_type") long erase(@Cast("tensorflow::EdgeSet::key_type") Edge key); // Caller is not allowed to mutate the EdgeSet while iterating. public native @ByVal EdgeSetIterator begin(); public native @ByVal EdgeSetIterator end(); } @Name("tensorflow::EdgeSet::const_iterator") @NoOffset public static class EdgeSetIterator extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public EdgeSetIterator(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public EdgeSetIterator(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public EdgeSetIterator position(long position) { return (EdgeSetIterator)super.position(position); } public EdgeSetIterator() { super((Pointer)null); allocate(); } private native void allocate(); public native @ByRef @Name("operator ++") EdgeSetIterator increment(); public native @ByVal @Name("operator ++") EdgeSetIterator increment(int arg0); public native @Cast("const tensorflow::EdgeSet::value_type*") @Name("operator ->") PointerPointer access(); public native @Cast("tensorflow::EdgeSet::value_type") @Name("operator *") Edge multiply(); public native @Cast("bool") @Name("operator ==") boolean equals(@Const @ByRef EdgeSetIterator other); public native @Cast("bool") @Name("operator !=") boolean notEquals(@Const @ByRef EdgeSetIterator other); } // gcc's set and multiset always use const_iterator since it will otherwise // allow modification of keys. // gcc's set and multiset always use const_iterator since it will otherwise // allow modification of keys. // namespace tensorflow // #endif // TENSORFLOW_GRAPH_EDGESET_H_ // Parsed from tensorflow/core/lib/gtl/iterator_range.h /* Copyright 2015 Google Inc. 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. ==============================================================================*/ // This provides a very simple, boring adaptor for a begin and end iterator // into a range type. This should be used to build range views that work well // with range based for loops and range based constructors. // // Note that code here follows more standards-based coding conventions as it // is mirroring proposed interfaces for standardization. // // Converted from chandlerc@'s code to Google style by joshl@. // #ifndef TENSORFLOW_LIB_GTL_ITERATOR_RANGE_H_ // #define TENSORFLOW_LIB_GTL_ITERATOR_RANGE_H_ // #include // A range adaptor for a pair of iterators. // // This just wraps two iterators into a range-compatible interface. Nothing // fancy at all. @Name("tensorflow::gtl::iterator_range") @NoOffset public static class NeighborIterRange extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public NeighborIterRange(Pointer p) { super(p); } public NeighborIterRange(@ByVal NeighborIter begin_iterator, @ByVal NeighborIter end_iterator) { super((Pointer)null); allocate(begin_iterator, end_iterator); } private native void allocate(@ByVal NeighborIter begin_iterator, @ByVal NeighborIter end_iterator); public native @ByVal NeighborIter begin(); public native @ByVal NeighborIter end(); } @Name("tensorflow::gtl::iterator_range") @NoOffset public static class NodeIterRange extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public NodeIterRange(Pointer p) { super(p); } public NodeIterRange(@ByVal NodeIter begin_iterator, @ByVal NodeIter end_iterator) { super((Pointer)null); allocate(begin_iterator, end_iterator); } private native void allocate(@ByVal NodeIter begin_iterator, @ByVal NodeIter end_iterator); public native @ByVal NodeIter begin(); public native @ByVal NodeIter end(); } // Convenience function for iterating over sub-ranges. // // This provides a bit of syntactic sugar to make using sub-ranges // in for loops a bit easier. Analogous to std::make_pair(). // namespace gtl // namespace tensorflow // #endif // TENSORFLOW_LIB_GTL_ITERATOR_RANGE_H_ // Parsed from tensorflow/core/graph/graph.h /* Copyright 2015 Google Inc. 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. ==============================================================================*/ // A Graph describes a set of computations that are to be // performed, as well as the dependencies between those // computations. The basic model is a DAG (directed acyclic graph) with // * internal nodes representing computational operations to be performed; // * edges represent dependencies, indicating the target may only be // executed once the source has completed; and // * predefined "source" (start) and "sink" (finish) nodes -- the source // should be the only node that doesn't depend on anything, and the sink // should be the only node that nothing depends on. // // Note: Node ids are intended to be relatively dense in the // 0..max_id range, but there may be gaps since ids won't be reused. // // Note: Some dependencies between operations are due to one operation // consuming the output of another. In fact operations can produce // multiple outputs and consume multiple inputs, and some // optimizations will care about which specific outputs are connected // to which specific inputs. We therefore represent data dependency // between output O of layer A and input I of layer B using // "input index" and "output index" labels per edge. // #ifndef TENSORFLOW_GRAPH_GRAPH_H_ // #define TENSORFLOW_GRAPH_GRAPH_H_ // #include // #include // #include // #include "tensorflow/core/framework/graph.pb.h" // #include "tensorflow/core/framework/op.h" // #include "tensorflow/core/framework/types.h" // #include "tensorflow/core/framework/versions.pb.h" // #include "tensorflow/core/graph/edgeset.h" // #include "tensorflow/core/lib/core/arena.h" // #include "tensorflow/core/lib/core/refcount.h" // #include "tensorflow/core/lib/core/status.h" // #include "tensorflow/core/lib/gtl/iterator_range.h" // #include "tensorflow/core/platform/logging.h" // #include "tensorflow/core/platform/macros.h" // #include "tensorflow/core/platform/types.h" @Namespace("tensorflow") @Opaque public static class EdgeSetTest extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public EdgeSetTest() { super((Pointer)null); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public EdgeSetTest(Pointer p) { super(p); } } // Declared below // Declared below @Namespace("tensorflow") @NoOffset public static class Node extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public Node(Pointer p) { super(p); } public native @StdString BytePointer DebugString(); public native int id(); public native int cost_id(); public native @StdString BytePointer name(); public native @StdString BytePointer type_string(); public native @Const @ByRef NodeDef def(); public native @Const @ByRef OpDef op_def(); // input and output types public native int num_inputs(); public native @Cast("tensorflow::DataType") int input_type(int i); public native @Const @ByRef DataTypeVector input_types(); public native int num_outputs(); public native @Cast("tensorflow::DataType") int output_type(int o); public native @Const @ByRef DataTypeVector output_types(); // This gives the device the runtime has assigned this node to. If // you want the device the user requested, use def().device() instead. // TODO(josh11b): Validate that the assigned_device, if not empty: // fully specifies a device, and satisfies def().device(). // TODO(josh11b): Move device_name outside of Node into a NodeId->DeviceName // map. public native @StdString BytePointer assigned_device_name(); public native void set_assigned_device_name(@StdString BytePointer device_name); public native void set_assigned_device_name(@StdString String device_name); // Get the neighboring nodes via edges either in or out of this node. public native @ByVal NeighborIterRange in_nodes(); public native @ByVal NeighborIterRange out_nodes(); public native @Const @ByRef EdgeSet in_edges(); public native @Const @ByRef EdgeSet out_edges(); // Node type helpers. public native @Cast("bool") boolean IsSource(); public native @Cast("bool") boolean IsSink(); // Anything other than the special Source & Sink nodes. public native @Cast("bool") boolean IsOp(); // Node class helpers public native @Cast("bool") boolean IsSwitch(); public native @Cast("bool") boolean IsMerge(); public native @Cast("bool") boolean IsEnter(); public native @Cast("bool") boolean IsExit(); public native @Cast("bool") boolean IsNextIteration(); public native @Cast("bool") boolean IsLoopCond(); public native @Cast("bool") boolean IsControlTrigger(); public native @Cast("bool") boolean IsSend(); public native @Cast("bool") boolean IsRecv(); public native @Cast("bool") boolean IsConstant(); public native @Cast("bool") boolean IsVariable(); public native @Cast("bool") boolean IsIdentity(); public native @Cast("bool") boolean IsGetSessionHandle(); public native @Cast("bool") boolean IsGetSessionTensor(); public native @Cast("bool") boolean IsDeleteSessionTensor(); public native @Cast("bool") boolean IsControlFlow(); } @Namespace("tensorflow") @NoOffset public static class Edge extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public Edge(Pointer p) { super(p); } public native Node src(); public native Node dst(); public native int id(); // Return the number of the source output that produces the data // carried by this edge. The special value kControlSlot is used // for control dependencies. public native int src_output(); // Return the number of the destination input that consumes the data // carried by this edge. The special value kControlSlot is used // for control dependencies. public native int dst_input(); // Return true iff this is an edge that indicates a control-flow // (as opposed to a data-flow) dependency. public native @Cast("bool") boolean IsControlEdge(); } // Thread compatible but not thread safe. @Namespace("tensorflow") @NoOffset public static class Graph extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public Graph(Pointer p) { super(p); } // Constructs a graph with a single SOURCE (always id kSourceId) and a // single SINK (always id kSinkId) node, and an edge from SOURCE->SINK. // // The graph can hold ops found in registry. public Graph(@Const OpRegistryInterface registry) { super((Pointer)null); allocate(registry); } private native void allocate(@Const OpRegistryInterface registry); @MemberGetter public static native int kControlSlot(); public static final int kControlSlot = kControlSlot(); // The GraphDef version range of this graph (see graph.proto). public native @Const @ByRef VersionDef versions(); public native void set_versions(@Const @ByRef VersionDef versions); // Adds a new node to this graph, and returns it. Infers the Op and // input/output types for the node. *this owns the returned instance. // Returns nullptr and sets *status on error. public native Node AddNode(@Const @ByRef NodeDef node_def, Status status); // Copies *node, which may belong to another graph, to a new node, // which is returned. Does not copy any edges. *this owns the // returned instance. public native Node CopyNode(Node node); // Remove a node from this graph, including all edges from or to it. // *node should not be accessed after calling this function. // REQUIRES: node->IsOp() public native void RemoveNode(Node node); // Add an edge that connects the xth output of "source" to the yth input // of "dest". public native @Const Edge AddEdge(Node source, int x, Node dest, int y); // Add a control-edge (no data flows along this edge) that // connects "source" to "dest". public native @Const Edge AddControlEdge(Node source, Node dest); // Removes edge from the graph. // REQUIRES: The edge must exist. public native void RemoveEdge(@Const Edge edge); // The number of live nodes in the graph. // // Because nodes can be removed from the graph, num_nodes() is often // smaller than num_node_ids(). If one needs to create an array of // nodes indexed by node ids, num_node_ids() should be used as the // array's size. public native int num_nodes(); // The number of live edges in the graph. // // Because edges can be removed from the graph, num_edges() is often // smaller than num_edge_ids(). If one needs to create an array of // edges indexed by edge ids, num_edge_ids() should be used as the // array's size. public native int num_edges(); // Serialize to a GraphDef. public native void ToGraphDef(GraphDef graph_def); // Generate new node name with the specified prefix that is unique // across this graph. public native @StdString BytePointer NewName(@StringPiece BytePointer prefix); public native @StdString String NewName(@StringPiece String prefix); // Access to the list of all nodes. Example usage: // for (Node* node : graph.nodes()) { ... } public native @ByVal NodeIterRange nodes(); // Returns one more than the maximum id assigned to any node. public native int num_node_ids(); // Returns the node associated with an id, or nullptr if no node // with that id (the node with that id was removed and the id has // not yet been re-used). *this owns the returned instance. // REQUIRES: 0 <= id < num_node_ids(). public native Node FindNodeId(int id); // Returns one more than the maximum id assigned to any edge. public native int num_edge_ids(); // Returns the Edge associated with an id, or nullptr if no edge // with that id (the node with that id was removed and the id has // not yet been re-used). *this owns the returned instance. // REQUIRES: 0 <= id < num_node_ids(). public native @Const Edge FindEdgeId(int id); // Access to the set of all edges. Example usage: // for (const Edge* e : graph.edges()) { ... } public native @Const @ByRef EdgeSet edges(); // The pre-defined nodes. /** enum tensorflow::Graph:: */ public static final int kSourceId = 0, kSinkId = 1; public native Node source_node(); public native Node sink_node(); public native @Const OpRegistryInterface op_registry(); } // TODO(josh11b): We may want to support keeping an index on various // node/edge attributes in a graph, particularly node names. // Helper routines @Namespace("tensorflow") public static native @Cast("bool") boolean IsSwitch(@Const Node node); @Namespace("tensorflow") public static native @Cast("bool") boolean IsMerge(@Const Node node); @Namespace("tensorflow") public static native @Cast("bool") boolean IsEnter(@Const Node node); @Namespace("tensorflow") public static native @Cast("bool") boolean IsExit(@Const Node node); @Namespace("tensorflow") public static native @Cast("bool") boolean IsNextIteration(@Const Node n); @Namespace("tensorflow") public static native @Cast("bool") boolean IsLoopCond(@Const Node node); @Namespace("tensorflow") public static native @Cast("bool") boolean IsControlTrigger(@Const Node n); @Namespace("tensorflow") public static native @Cast("bool") boolean IsSend(@Const Node node); @Namespace("tensorflow") public static native @Cast("bool") boolean IsRecv(@Const Node node); // True for Nodes that mediate the transfer of values between processes. @Namespace("tensorflow") public static native @Cast("bool") boolean IsTransferNode(@Const Node n); @Namespace("tensorflow") public static native @Cast("bool") boolean IsConstant(@Const Node node); @Namespace("tensorflow") public static native @Cast("bool") boolean IsVariable(@Const Node node); @Namespace("tensorflow") public static native @Cast("bool") boolean IsIdentity(@Const Node node); // Returns true iff 'n' is a control flow node. @Namespace("tensorflow") public static native @Cast("bool") boolean IsControlFlow(@Const Node n); @Namespace("tensorflow") public static native @Cast("bool") boolean IsHostMemoryPreserving(@Const Node node); // Iterator for stepping through the nodes of a graph. @Namespace("tensorflow") @NoOffset public static class NodeIter extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public NodeIter(Pointer p) { super(p); } public NodeIter(@Const Graph graph, int id) { super((Pointer)null); allocate(graph, id); } private native void allocate(@Const Graph graph, int id); public native @Cast("bool") @Name("operator ==") boolean equals(@Const @ByRef NodeIter rhs); public native @Cast("bool") @Name("operator !=") boolean notEquals(@Const @ByRef NodeIter rhs); public native @Name("operator ++") void increment(); public native @Name("operator *") Node multiply(); public native @Name("operator ->") Node access(); } // Iterator for stepping through the neighbors of a node. @Namespace("tensorflow") @NoOffset public static class NeighborIter extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public NeighborIter(Pointer p) { super(p); } public NeighborIter(@ByVal EdgeSetIterator iter, @Cast("bool") boolean incoming) { super((Pointer)null); allocate(iter, incoming); } private native void allocate(@ByVal EdgeSetIterator iter, @Cast("bool") boolean incoming); public native @Cast("bool") @Name("operator ==") boolean equals(@Const @ByRef NeighborIter rhs); public native @Cast("bool") @Name("operator !=") boolean notEquals(@Const @ByRef NeighborIter rhs); public native @Name("operator ++") void increment(); public native @Name("operator *") Node multiply(); public native @Name("operator ->") Node access(); } // IMPLEMENTATION DETAILS, PLEASE IGNORE // namespace tensorflow // #endif // TENSORFLOW_GRAPH_GRAPH_H_ // Parsed from tensorflow/core/framework/node_def_builder.h /* Copyright 2015 Google Inc. 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_FRAMEWORK_NODE_DEF_BUILDER_H_ // #define TENSORFLOW_FRAMEWORK_NODE_DEF_BUILDER_H_ // #include // #include // #include "tensorflow/core/framework/attr_value_util.h" // #include "tensorflow/core/framework/graph.pb.h" // #include "tensorflow/core/framework/node_def_util.h" // #include "tensorflow/core/framework/op.h" // #include "tensorflow/core/framework/op_def.pb.h" // #include "tensorflow/core/framework/types.h" // #include "tensorflow/core/lib/core/status.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // #include "tensorflow/core/lib/strings/strcat.h" // This is a helper for creating a NodeDef. Automatically sets attrs // that can be inferred from the inputs, and uses default values // (where they exist) for unspecified attrs. Example usage: // // NodeDef node_def; // Status status = NodeDefBuilder(node_name, op_name) // .Input(...) // .Attr(...) // .Finalize(&node_def); // if (!status.ok()) return status; // // Use node_def here. @Namespace("tensorflow") @NoOffset public static class NodeDefBuilder extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public NodeDefBuilder(Pointer p) { super(p); } // To specify an output to be consumed by one of the Input() methods below. @NoOffset public static class NodeOut extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public NodeOut(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public NodeOut(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public NodeOut position(long position) { return (NodeOut)super.position(position); } public NodeOut(@StringPiece BytePointer n, int i, @Cast("tensorflow::DataType") int dt) { super((Pointer)null); allocate(n, i, dt); } private native void allocate(@StringPiece BytePointer n, int i, @Cast("tensorflow::DataType") int dt); public NodeOut(@StringPiece String n, int i, @Cast("tensorflow::DataType") int dt) { super((Pointer)null); allocate(n, i, dt); } private native void allocate(@StringPiece String n, int i, @Cast("tensorflow::DataType") int dt); public NodeOut() { super((Pointer)null); allocate(); } private native void allocate(); // uninitialized, call Reset() before use. public native void Reset(@StringPiece BytePointer n, int i, @Cast("tensorflow::DataType") int dt); public native void Reset(@StringPiece String n, int i, @Cast("tensorflow::DataType") int dt); public native @StdString BytePointer node(); public native NodeOut node(BytePointer node); public native int index(); public native NodeOut index(int index); public native @Cast("tensorflow::DataType") int data_type(); public native NodeOut data_type(int data_type); } // Specify the name and the Op (either via an OpDef or the name of // the Op plus a registry) for the NodeDef. Other fields are // specified by calling the methods below. // REQUIRES: The OpDef must satisfy ValidateOpDef(). public NodeDefBuilder(@StringPiece BytePointer name, @StringPiece BytePointer op_name, @Const OpRegistryInterface op_registry/*=tensorflow::OpRegistry::Global()*/) { super((Pointer)null); allocate(name, op_name, op_registry); } private native void allocate(@StringPiece BytePointer name, @StringPiece BytePointer op_name, @Const OpRegistryInterface op_registry/*=tensorflow::OpRegistry::Global()*/); public NodeDefBuilder(@StringPiece BytePointer name, @StringPiece BytePointer op_name) { super((Pointer)null); allocate(name, op_name); } private native void allocate(@StringPiece BytePointer name, @StringPiece BytePointer op_name); public NodeDefBuilder(@StringPiece String name, @StringPiece String op_name, @Const OpRegistryInterface op_registry/*=tensorflow::OpRegistry::Global()*/) { super((Pointer)null); allocate(name, op_name, op_registry); } private native void allocate(@StringPiece String name, @StringPiece String op_name, @Const OpRegistryInterface op_registry/*=tensorflow::OpRegistry::Global()*/); public NodeDefBuilder(@StringPiece String name, @StringPiece String op_name) { super((Pointer)null); allocate(name, op_name); } private native void allocate(@StringPiece String name, @StringPiece String op_name); // REQUIRES: in addition, *op_def must outlive *this. public NodeDefBuilder(@StringPiece BytePointer name, @Const OpDef op_def) { super((Pointer)null); allocate(name, op_def); } private native void allocate(@StringPiece BytePointer name, @Const OpDef op_def); public NodeDefBuilder(@StringPiece String name, @Const OpDef op_def) { super((Pointer)null); allocate(name, op_def); } private native void allocate(@StringPiece String name, @Const OpDef op_def); // You must call one Input() function per input_arg in the Op, // *and in the same order as the input_args appear in the OpDef.* // For inputs that take a single tensor. public native @ByRef NodeDefBuilder Input(@StringPiece BytePointer src_node, int src_index, @Cast("tensorflow::DataType") int dt); public native @ByRef NodeDefBuilder Input(@StringPiece String src_node, int src_index, @Cast("tensorflow::DataType") int dt); public native @ByRef NodeDefBuilder Input(@Const @ByRef NodeOut src); // For inputs that take a list of tensors. // To create inputs in tests, see fake_input.h. public native @ByRef NodeDefBuilder Input(@ByVal @Cast("tensorflow::FakeInputFunctor*") Fn fake_input); // Specify that this node must only run after src_node. public native @ByRef NodeDefBuilder ControlInput(@StringPiece BytePointer src_node); public native @ByRef NodeDefBuilder ControlInput(@StringPiece String src_node); // Constrains what devices this node may be scheduled on. public native @ByRef NodeDefBuilder Device(@StringPiece BytePointer device_spec); public native @ByRef NodeDefBuilder Device(@StringPiece String device_spec); // Sets the attr, if not already set. If already set with a different // value, an error will be returned from Finalize(). // Note: overload needed to allow {...} expressions for value. // Finish building the NodeDef, returning any errors or setting // *node_def if none. // WARNING: Not all problems are detected! The resulting NodeDef may // not be valid! Call ValidateNodeDef() from node_def_utils to be sure. public native @ByVal Status Finalize(NodeDef node_def); // Accessor for the OpDef set in the constructor. public native @Const @ByRef OpDef op_def(); } // IMPLEMENTATION ------------------------------------------------------------- // namespace tensorflow // #endif // TENSORFLOW_FRAMEWORK_NODE_DEF_BUILDER_H_ // Parsed from tensorflow/core/graph/node_builder.h /* Copyright 2015 Google Inc. 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_NODE_BUILDER_H_ // #define TENSORFLOW_GRAPH_NODE_BUILDER_H_ // #include // #include "tensorflow/core/framework/node_def_builder.h" // #include "tensorflow/core/framework/op.h" // #include "tensorflow/core/framework/op_def.pb.h" // #include "tensorflow/core/graph/graph.h" // #include "tensorflow/core/lib/core/status.h" // #include "tensorflow/core/lib/core/stringpiece.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // This is a helper for creating a Node and adding it to a Graph. // Internally, it uses a NodeDefBuilder to automatically set attrs // that can be inferred from the inputs, and use default values // (where they exist) for unspecified attrs. Example usage: // // Node* node; // Status status = NodeBuilder(node_name, op_name) // .Input(...) // .Attr(...) // .Finalize(&graph, &node); // if (!status.ok()) return status; // // Use node here. @Namespace("tensorflow") @NoOffset public static class NodeBuilder extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public NodeBuilder(Pointer p) { super(p); } // For specifying the output of a Node to provide to one of the Input() // functions below. It supports both regular inputs (where you are // connecting to an existing Node*), and inputs from outside the graph // (or haven't been added to the graph yet, like back edges, where // you don't have a Node*). Both types can be mixed, e.g. in an // ArraySlice. @NoOffset public static class NodeOut extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public NodeOut(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public NodeOut(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public NodeOut position(long position) { return (NodeOut)super.position(position); } // For referencing an existing Node. public NodeOut(Node n, int i/*=0*/) { super((Pointer)null); allocate(n, i); } private native void allocate(Node n, int i/*=0*/); public NodeOut(Node n) { super((Pointer)null); allocate(n); } private native void allocate(Node n); // For referencing Nodes not in the graph being built. It is // useful when preparing a graph for ExtendSession or creating a // back edge to a node that hasn't been added to the graph yet, // but will be. public NodeOut(@StringPiece BytePointer name, int i, @Cast("tensorflow::DataType") int t) { super((Pointer)null); allocate(name, i, t); } private native void allocate(@StringPiece BytePointer name, int i, @Cast("tensorflow::DataType") int t); public NodeOut(@StringPiece String name, int i, @Cast("tensorflow::DataType") int t) { super((Pointer)null); allocate(name, i, t); } private native void allocate(@StringPiece String name, int i, @Cast("tensorflow::DataType") int t); // Default constructor for std::vector. public NodeOut() { super((Pointer)null); allocate(); } private native void allocate(); public native Node node(); public native NodeOut node(Node node); // error is set to true if: // * the NodeOut was default constructed and never overwritten, // * a nullptr Node* was passed to the NodeOut constructor, or // * an out-of-range index was passed to the NodeOut constructor. public native @Cast("bool") boolean error(); public native NodeOut error(boolean error); public native @StdString BytePointer name(); public native NodeOut name(BytePointer name); public native int index(); public native NodeOut index(int index); public native @Cast("tensorflow::DataType") int dt(); public native NodeOut dt(int dt); } // Specify the name and the Op (either via an OpDef or the name of // the Op plus a registry) for the Node. Other fields are // specified by calling the methods below. // REQUIRES: The OpDef must satisfy ValidateOpDef(). public NodeBuilder(@StringPiece BytePointer name, @StringPiece BytePointer op_name, @Const OpRegistryInterface op_registry/*=tensorflow::OpRegistry::Global()*/) { super((Pointer)null); allocate(name, op_name, op_registry); } private native void allocate(@StringPiece BytePointer name, @StringPiece BytePointer op_name, @Const OpRegistryInterface op_registry/*=tensorflow::OpRegistry::Global()*/); public NodeBuilder(@StringPiece BytePointer name, @StringPiece BytePointer op_name) { super((Pointer)null); allocate(name, op_name); } private native void allocate(@StringPiece BytePointer name, @StringPiece BytePointer op_name); public NodeBuilder(@StringPiece String name, @StringPiece String op_name, @Const OpRegistryInterface op_registry/*=tensorflow::OpRegistry::Global()*/) { super((Pointer)null); allocate(name, op_name, op_registry); } private native void allocate(@StringPiece String name, @StringPiece String op_name, @Const OpRegistryInterface op_registry/*=tensorflow::OpRegistry::Global()*/); public NodeBuilder(@StringPiece String name, @StringPiece String op_name) { super((Pointer)null); allocate(name, op_name); } private native void allocate(@StringPiece String name, @StringPiece String op_name); public NodeBuilder(@StringPiece BytePointer name, @Const OpDef op_def) { super((Pointer)null); allocate(name, op_def); } private native void allocate(@StringPiece BytePointer name, @Const OpDef op_def); public NodeBuilder(@StringPiece String name, @Const OpDef op_def) { super((Pointer)null); allocate(name, op_def); } private native void allocate(@StringPiece String name, @Const OpDef op_def); // Create a NodeBuilder from an existing NodeDefBuilder. public NodeBuilder(@Const @ByRef NodeDefBuilder def_builder) { super((Pointer)null); allocate(def_builder); } private native void allocate(@Const @ByRef NodeDefBuilder def_builder); // You must call one Input() function per input_arg in the Op, // *and in the same order as the input_args appear in the OpDef.* // For inputs that take a single tensor. public native @ByRef NodeBuilder Input(Node src_node, int src_index/*=0*/); public native @ByRef NodeBuilder Input(Node src_node); public native @ByRef NodeBuilder Input(@ByVal NodeOut src); // For inputs that take a list of tensors. // Require that this node run after src_node(s). public native @ByRef NodeBuilder ControlInput(Node src_node); public native @ByRef NodeBuilder ControlInputs(@ByVal NodeVector src_nodes); // Sets the "requested device spec" in the NodeDef (not the // "assigned device" in the Node). public native @ByRef NodeBuilder Device(@StringPiece BytePointer device_spec); public native @ByRef NodeBuilder Device(@StringPiece String device_spec); // Set the value of an attr. attr_name must match the name of one of // attrs defined by the Op, and value must have the corresponding type // (see SetAttrValue() in ../framework/attr_value_util.h for legal // types for value). Note that attrs will be set automatically if // they can be determined by the inputs. // Validates the described node and adds it to *graph, adding edges // for all (non-back) inputs. If created_node is not nullptr, // *created_node will be set to the new node (or nullptr on error). public native @ByVal Status Finalize(Graph graph, @Cast("tensorflow::Node**") PointerPointer created_node); public native @ByVal Status Finalize(Graph graph, @ByPtrPtr Node created_node); } // IMPLEMENTATION ------------------------------------------------------------- // namespace tensorflow // #endif // TENSORFLOW_GRAPH_NODE_BUILDER_H_ // Parsed from tensorflow/core/graph/graph_def_builder.h /* Copyright 2015 Google Inc. 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_GRAPH_DEF_BUILDER_H_ // #define TENSORFLOW_GRAPH_GRAPH_DEF_BUILDER_H_ // #include // #include "tensorflow/core/framework/graph.pb.h" // #include "tensorflow/core/framework/op.h" // #include "tensorflow/core/graph/graph.h" // #include "tensorflow/core/graph/node_builder.h" // #include "tensorflow/core/lib/core/status.h" // #include "tensorflow/core/lib/core/stringpiece.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // Given a function like: // namespace ops { // Node* Identity(NodeOut input, const GraphDefBuilder::Options& opts) { // if (opts.HaveError()) return nullptr; // static const string kOpName = "Identity"; // NodeBuilder node_builder(opts.GetNameForOp(kOpName), kOpName, // opts.op_registry()); // node_builder.Input(input); // return opts.FinalizeBuilder(&node_builder); // } // } // namespace ops // // // Or, alternatively: // namespace ops { // Node* Identity(NodeOut input, const GraphDefBuilder::Options& opts) { // static const string kOpName = "Identity"; // return UnaryOp(kOpName, input, opts); // } // } // namespace ops // // You call it like: // GraphDefBuilder b; // using namespace ::tensorflow::ops; // NOLINT(build/namespaces) // Node* a = Const(7, b.opts()); // // Note: WithName() returns a copy, opts is unchanged. // Node* b = Const(5, b.opts().WithName("control-input")); // Node* c = Identity(a, b.opts().WithControlInput(b)); // GraphDef graph_def; // Status status = b.ToGraphDef(&graph_def); // if (!status.ok()) { /* Handle error */ } // // In tests you can skip the status handling via: // GraphDefBuilder b(GraphDefBuilder::kFailImmediately); // ... // b.ToGraphDef(&graph_def); @Namespace("tensorflow") @NoOffset public static class GraphDefBuilder extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public GraphDefBuilder(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public GraphDefBuilder(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public GraphDefBuilder position(long position) { return (GraphDefBuilder)super.position(position); } // Options for adding a Node to a Graph. @NoOffset public static class Options extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public Options(Pointer p) { super(p); } // Sets the Graph (that Nodes will be added to) and the status. The // status may be set to nullptr, in which case errors cause CHECK // failures. The graph and status must outlive *this. public Options(Graph graph, Status status) { super((Pointer)null); allocate(graph, status); } private native void allocate(Graph graph, Status status); // Methods for setting options. These are const methods: they // return a copy of *this with the option set. public native @ByVal Options WithName(@StringPiece BytePointer name); public native @ByVal Options WithName(@StringPiece String name); public native @ByVal Options WithDevice(@StringPiece BytePointer device); public native @ByVal Options WithDevice(@StringPiece String device); public native @ByVal Options WithControlInput(Node control_input); public native @ByVal Options WithControlInputs(@ByVal NodeVector control_inputs); // Override the default value for an optional attr. public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, int value); public native @ByVal Options WithAttr(@StringPiece String attr_name, int value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @ArraySlice IntPointer value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @ArraySlice IntBuffer value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @ArraySlice int... value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @ArraySlice IntPointer value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @ArraySlice IntBuffer value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @ArraySlice int... value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @Cast("long long") long value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @Cast("long long") long value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @Cast("long long*") @ArraySlice LongPointer value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @Cast("long long*") @ArraySlice LongBuffer value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @Cast("long long*") @ArraySlice long... value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @Cast("long long*") @ArraySlice LongPointer value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @Cast("long long*") @ArraySlice LongBuffer value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @Cast("long long*") @ArraySlice long... value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, float value); public native @ByVal Options WithAttr(@StringPiece String attr_name, float value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @ArraySlice FloatPointer value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @ArraySlice FloatBuffer value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @ArraySlice float... value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @ArraySlice FloatPointer value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @ArraySlice FloatBuffer value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @ArraySlice float... value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, double value); public native @ByVal Options WithAttr(@StringPiece String attr_name, double value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @ArraySlice DoublePointer value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @ArraySlice DoubleBuffer value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @ArraySlice double... value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @ArraySlice DoublePointer value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @ArraySlice DoubleBuffer value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @ArraySlice double... value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @Cast("bool") boolean value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @Cast("bool") boolean value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @Cast("bool*") @ArraySlice BoolPointer value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @Cast("bool*") @ArraySlice boolean... value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @StdString BytePointer value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @StdString String value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @ByVal StringVector value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @ByVal StringVector value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @ByVal Tensor value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @ByVal Tensor value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @ByVal TensorVector value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @ByVal TensorVector value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @ByVal TensorProto value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @ByVal TensorProto value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @ByVal TensorProtoVector value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @ByVal TensorProtoVector value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @ByVal TensorShape value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @ByVal TensorShape value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @ByVal TensorShapeVector value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @ByVal TensorShapeVector value); public native @ByVal Options WithAttr(@StringPiece BytePointer attr_name, @ByVal NameAttrList value); public native @ByVal Options WithAttr(@StringPiece String attr_name, @ByVal NameAttrList value); // Note: overload needed to allow {...} expressions for value. // Methods for using options from a function that creates a Node. // Returns true if the status associated with *this has an error. // Use this to skip processing that may depend on prior results. public native @Cast("bool") boolean HaveError(); // Given the Op type name, return a name for a node of that type. // Uses the value set in WithName() if that has been called. Otherwise, // returns a name built out of the Op type name. public native @StdString BytePointer GetNameForOp(@StringPiece BytePointer op); public native @StdString String GetNameForOp(@StringPiece String op); // Sets the device, adds control inputs, adds attrs, and calls Finalize(). // If Finalize returns an error, it is saved and this function returns // nullptr. public native Node FinalizeBuilder(NodeBuilder builder); // Updates the associated status, if any, or calls TF_CHECK_OK if none. public native void UpdateStatus(@Const @ByRef Status status); // Accessor public native @Const OpRegistryInterface op_registry(); } // Start building a new graph. public GraphDefBuilder( @Const OpRegistryInterface op_registry/*=tensorflow::OpRegistry::Global()*/) { super((Pointer)null); allocate(op_registry); } private native void allocate( @Const OpRegistryInterface op_registry/*=tensorflow::OpRegistry::Global()*/); public GraphDefBuilder() { super((Pointer)null); allocate(); } private native void allocate(); // For use in tests, where you want to fail immediately on error instead // of checking the status at the end. /** enum tensorflow::GraphDefBuilder::TestFailImmediatelyType */ public static final int kFailImmediately = 0; public GraphDefBuilder( @Cast("tensorflow::GraphDefBuilder::TestFailImmediatelyType") int arg0, @Const OpRegistryInterface op_registry/*=tensorflow::OpRegistry::Global()*/) { super((Pointer)null); allocate(arg0, op_registry); } private native void allocate( @Cast("tensorflow::GraphDefBuilder::TestFailImmediatelyType") int arg0, @Const OpRegistryInterface op_registry/*=tensorflow::OpRegistry::Global()*/); public GraphDefBuilder( @Cast("tensorflow::GraphDefBuilder::TestFailImmediatelyType") int arg0) { super((Pointer)null); allocate(arg0); } private native void allocate( @Cast("tensorflow::GraphDefBuilder::TestFailImmediatelyType") int arg0); // Gets the Options with the associated Graph and Status. public native @Const @ByRef Options opts(); // Once all the nodes have been added, call this to get whether it was // successful, and if so fill *graph_def. public native @ByVal Status ToGraphDef(GraphDef graph_def); // Like ToGraphDef(), but converts to a Graph (using the default // GraphConstructorOptions). // TODO(josh11b): Make this faster; right now it converts // Graph->GraphDef->Graph. This cleans up the graph (e.g. adds // edges from the source and to the sink node, resolves back edges // by name), and makes sure the resulting graph is valid. public native @ByVal Status ToGraph(Graph graph); } // A NodeOut may either be a regular input or back input. Regular // inputs are specified via either a Node* or a Node* and an output // index. Back inputs are specified by a node name, output index, and // output type. // For adding an Op with no inputs to a GraphDefBuilder. @Namespace("tensorflow::ops") public static native Node SourceOp(@StdString BytePointer op_name, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SourceOp(@StdString String op_name, @Const @ByRef GraphDefBuilder.Options opts); // For adding an Op with one input to a GraphDefBuilder. @Namespace("tensorflow::ops") public static native Node UnaryOp(@StdString BytePointer op_name, @ByVal NodeBuilder.NodeOut input, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node UnaryOp(@StdString String op_name, Node input, @Const @ByRef GraphDefBuilder.Options opts); // For adding an Op with two inputs to a GraphDefBuilder. @Namespace("tensorflow::ops") public static native Node BinaryOp(@StdString BytePointer op_name, @ByVal NodeBuilder.NodeOut a, @ByVal NodeBuilder.NodeOut b, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BinaryOp(@StdString String op_name, Node a, Node b, @Const @ByRef GraphDefBuilder.Options opts); // namespace ops // namespace tensorflow // #endif // TENSORFLOW_GRAPH_GRAPH_DEF_BUILDER_H_ // Parsed from tensorflow/core/graph/default_device.h /* Copyright 2015 Google Inc. 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_DEFAULT_DEVICE_H_ // #define TENSORFLOW_GRAPH_DEFAULT_DEVICE_H_ // #include // #include "tensorflow/core/framework/graph.pb.h" // Sets the default device for all nodes in graph_def to "device", // only if not already set. @Namespace("tensorflow::graph") public static native void SetDefaultDevice(@StdString BytePointer device, GraphDef graph_def); @Namespace("tensorflow::graph") public static native void SetDefaultDevice(@StdString String device, GraphDef graph_def); // namespace graph // namespace tensorflow // #endif // TENSORFLOW_GRAPH_DEFAULT_DEVICE_H_ // Parsed from tensorflow/core/graph/graph_constructor.h /* Copyright 2015 Google Inc. 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_GRAPH_CONSTRUCTOR_H_ // #define TENSORFLOW_GRAPH_GRAPH_CONSTRUCTOR_H_ // #include "tensorflow/core/framework/graph.pb.h" // #include "tensorflow/core/graph/graph.h" // #include "tensorflow/core/lib/core/status.h" // #include "tensorflow/core/protobuf/config.pb.h" // Options specific to constant folding optimizations. @Namespace("tensorflow") public static class ConstantFoldingOptions extends Pointer { static { Loader.load(); } /** Default native constructor. */ public ConstantFoldingOptions() { super((Pointer)null); allocate(); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public ConstantFoldingOptions(long size) { super((Pointer)null); allocateArray(size); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public ConstantFoldingOptions(Pointer p) { super(p); } private native void allocate(); private native void allocateArray(long size); @Override public ConstantFoldingOptions position(long position) { return (ConstantFoldingOptions)super.position(position); } // If "consider" is not a nullptr, then only constant fold a node "n" if // consider(n) returns true. @MemberSetter public native ConstantFoldingOptions consider(@ByVal ConsiderFunction consider); } // Construct a graph *g out of a GraphDef gdef. Returns non-OK on // error, in which case *g is left in an incomplete state. @Namespace("tensorflow") @NoOffset public static class GraphConstructorOptions extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ public GraphConstructorOptions(Pointer p) { super(p); } /** Native array allocator. Access with {@link Pointer#position(long)}. */ public GraphConstructorOptions(long size) { super((Pointer)null); allocateArray(size); } private native void allocateArray(long size); @Override public GraphConstructorOptions position(long position) { return (GraphConstructorOptions)super.position(position); } public GraphConstructorOptions() { super((Pointer)null); allocate(); } private native void allocate(); public GraphConstructorOptions(@Const @ByRef OptimizerOptions opts) { super((Pointer)null); allocate(opts); } private native void allocate(@Const @ByRef OptimizerOptions opts); // If true, allows internal ops in the GraphDef. public native @Cast("bool") boolean allow_internal_ops(); public native GraphConstructorOptions allow_internal_ops(boolean allow_internal_ops); // If true, the graph def is expected to have fully specified // devices for all nodes. A node in the resulting graph "g" has the // device name set accordingly. // // TODO(zhifengc): if possible, consider removing this option. public native @Cast("bool") boolean expect_device_spec(); public native GraphConstructorOptions expect_device_spec(boolean expect_device_spec); // If true, perform common subexpression elimination on the graph. // TODO(jeff): Turn this default to true? public native @Cast("bool") boolean optimizer_do_cse(); public native GraphConstructorOptions optimizer_do_cse(boolean optimizer_do_cse); // If "optimizer_do_cse" is true and "cse_consider_function" is // not nullptr, then only consider nodes for CSE for which // "cse_consider_function(node)" returns true. @MemberSetter public native GraphConstructorOptions cse_consider_function(@ByVal ConsiderFunction cse_consider_function); // If true, perform constant folding on the graph. public native @Cast("bool") boolean optimizer_do_constant_folding(); public native GraphConstructorOptions optimizer_do_constant_folding(boolean optimizer_do_constant_folding); public native @ByRef ConstantFoldingOptions constant_folding_opts(); public native GraphConstructorOptions constant_folding_opts(ConstantFoldingOptions constant_folding_opts); } @Namespace("tensorflow") public static native @ByVal Status ConvertGraphDefToGraph(@Const @ByRef GraphConstructorOptions opts, @Const @ByRef GraphDef gdef, Graph g); // Make a copy of "src" into "*dest". // // REQUIRES: "*dest" is a freshly allocated graph without any nodes or edges // other than the implicit Source/Sink nodes. @Namespace("tensorflow") public static native void CopyGraph(@Const @ByRef Graph src, Graph dest); // namespace tensorflow // #endif // TENSORFLOW_GRAPH_GRAPH_CONSTRUCTOR_H_ // Parsed from tensorflow/cc/ops/standard_ops.h /* Copyright 2015 Google Inc. 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. ==============================================================================*/ // #include this file to get access to the standard set of C++ graph // definition libraries. // #ifndef TENSORFLOW_CC_OPS_STANDARD_OPS_H_ // #define TENSORFLOW_CC_OPS_STANDARD_OPS_H_ // #include "tensorflow/cc/ops/array_ops.h" // #include "tensorflow/cc/ops/const_op.h" // #include "tensorflow/cc/ops/data_flow_ops.h" // #include "tensorflow/cc/ops/image_ops.h" // #include "tensorflow/cc/ops/io_ops.h" // #include "tensorflow/cc/ops/linalg_ops.h" // #include "tensorflow/cc/ops/logging_ops.h" // #include "tensorflow/cc/ops/math_ops.h" // #include "tensorflow/cc/ops/nn_ops.h" // #include "tensorflow/cc/ops/parsing_ops.h" // #include "tensorflow/cc/ops/random_ops.h" // #include "tensorflow/cc/ops/sparse_ops.h" // #include "tensorflow/cc/ops/state_ops.h" // #include "tensorflow/cc/ops/string_ops.h" // #include "tensorflow/cc/ops/training_ops.h" // #include "tensorflow/cc/ops/user_ops.h" // #endif // TENSORFLOW_CC_OPS_STANDARD_OPS_H_ // Parsed from tensorflow/cc/ops/const_op.h /* Copyright 2015 Google Inc. 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_CC_OPS_CONST_OP_H_ // #define TENSORFLOW_CC_OPS_CONST_OP_H_ // #include "tensorflow/core/framework/tensor.h" // #include "tensorflow/core/framework/tensor.pb.h" // #include "tensorflow/core/graph/graph_def_builder.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // If a shape is specified, you may either provide the same number of values, // or a single value and that value will be duplicated to fill out the Tensor. // #define DECLARE_CONST(TYPE) // Node* Const(TYPE s, const GraphDefBuilder::Options& options); /* Scalar */ // Node* Const(gtl::ArraySlice v, // const GraphDefBuilder::Options& options); /* Vector */ // Node* Const(gtl::ArraySlice t, const TensorShape& shape, // const GraphDefBuilder::Options& options); /* Tensor */ // inline Node* Const(std::initializer_list v, /* Vector using {...} */ // const GraphDefBuilder::Options& options) { // return Const(gtl::ArraySlice(v), options); // } // inline Node* Const(std::initializer_list t, /* Tensor using {...} */ // const TensorShape& shape, // const GraphDefBuilder::Options& options) { // return Const(gtl::ArraySlice(t), shape, options); // } @Namespace("tensorflow::ops") public static native Node Const(@Cast("Eigen::half") short s, @Const @ByRef GraphDefBuilder.Options options); /* Scalar */ @Namespace("tensorflow::ops") public static native Node Const(@Cast("Eigen::half*") @ArraySlice ShortPointer v, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@Cast("Eigen::half*") @ArraySlice ShortBuffer v, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@Cast("Eigen::half*") @ArraySlice short[] v, @Const @ByRef GraphDefBuilder.Options options); /* Vector */ @Namespace("tensorflow::ops") public static native Node Const(@Cast("Eigen::half*") @ArraySlice ShortPointer t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@Cast("Eigen::half*") @ArraySlice ShortBuffer t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@Cast("Eigen::half*") @ArraySlice short[] t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); /* Tensor */ @Namespace("tensorflow::ops") public static native Node Const(float s, @Const @ByRef GraphDefBuilder.Options options); /* Scalar */ @Namespace("tensorflow::ops") public static native Node Const(@ArraySlice FloatPointer v, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@ArraySlice FloatBuffer v, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@ArraySlice float[] v, @Const @ByRef GraphDefBuilder.Options options); /* Vector */ @Namespace("tensorflow::ops") public static native Node Const(@ArraySlice FloatPointer t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@ArraySlice FloatBuffer t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@ArraySlice float[] t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); /* Tensor */ @Namespace("tensorflow::ops") public static native Node Const(double s, @Const @ByRef GraphDefBuilder.Options options); /* Scalar */ @Namespace("tensorflow::ops") public static native Node Const(@ArraySlice DoublePointer v, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@ArraySlice DoubleBuffer v, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@ArraySlice double[] v, @Const @ByRef GraphDefBuilder.Options options); /* Vector */ @Namespace("tensorflow::ops") public static native Node Const(@ArraySlice DoublePointer t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@ArraySlice DoubleBuffer t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@ArraySlice double[] t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); /* Tensor */ @Namespace("tensorflow::ops") public static native Node Const(int s, @Const @ByRef GraphDefBuilder.Options options); /* Scalar */ @Namespace("tensorflow::ops") public static native Node Const(@ArraySlice IntPointer v, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@ArraySlice IntBuffer v, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@ArraySlice int[] v, @Const @ByRef GraphDefBuilder.Options options); /* Vector */ @Namespace("tensorflow::ops") public static native Node Const(@ArraySlice IntPointer t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@ArraySlice IntBuffer t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@ArraySlice int[] t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); /* Tensor */ @Namespace("tensorflow::ops") public static native Node Const(@Cast("tensorflow::uint8") byte s, @Const @ByRef GraphDefBuilder.Options options); /* Scalar */ @Namespace("tensorflow::ops") public static native Node Const(@Cast("tensorflow::uint8*") @ArraySlice BytePointer v, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@Cast("tensorflow::uint8*") @ArraySlice ByteBuffer v, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@Cast("tensorflow::uint8*") @ArraySlice byte[] v, @Const @ByRef GraphDefBuilder.Options options); /* Vector */ @Namespace("tensorflow::ops") public static native Node Const(@Cast("tensorflow::uint8*") @ArraySlice BytePointer t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@Cast("tensorflow::uint8*") @ArraySlice ByteBuffer t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@Cast("tensorflow::uint8*") @ArraySlice byte[] t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); /* Tensor */ /* Scalar */ /* Vector */ /* Tensor */ /* Scalar */ /* Vector */ /* Tensor */ /* Scalar */ /* Vector */ /* Tensor */ /* Scalar */ /* Vector */ /* Tensor */ @Namespace("tensorflow::ops") public static native Node Const(@Cast("tensorflow::int64") long s, @Const @ByRef GraphDefBuilder.Options options); /* Scalar */ @Namespace("tensorflow::ops") public static native Node Const(@Cast("tensorflow::int64*") @ArraySlice LongPointer v, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@Cast("tensorflow::int64*") @ArraySlice LongBuffer v, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@Cast("tensorflow::int64*") @ArraySlice long[] v, @Const @ByRef GraphDefBuilder.Options options); /* Vector */ @Namespace("tensorflow::ops") public static native Node Const(@Cast("tensorflow::int64*") @ArraySlice LongPointer t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@Cast("tensorflow::int64*") @ArraySlice LongBuffer t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@Cast("tensorflow::int64*") @ArraySlice long[] t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); /* Tensor */ @Namespace("tensorflow::ops") public static native Node Const(@Cast("bool") boolean s, @Const @ByRef GraphDefBuilder.Options options); /* Scalar */ @Namespace("tensorflow::ops") public static native Node Const(@Cast("bool*") @ArraySlice BoolPointer v, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@Cast("bool*") @ArraySlice boolean[] v, @Const @ByRef GraphDefBuilder.Options options); /* Vector */ @Namespace("tensorflow::ops") public static native Node Const(@Cast("bool*") @ArraySlice BoolPointer t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@Cast("bool*") @ArraySlice boolean[] t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); /* Tensor */ // #undef DECLARE_CONST // String @Namespace("tensorflow::ops") public static native Node Const(@Cast({"", "tensorflow::StringPiece&"}) @StringPiece String s, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@ByVal StringVector v, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@ByVal StringVector t, @Const @ByRef TensorShape shape, @Const @ByRef GraphDefBuilder.Options options); // A Tensor of any type. @Namespace("tensorflow::ops") public static native Node Const(@Const @ByRef Tensor t, @Const @ByRef GraphDefBuilder.Options options); @Namespace("tensorflow::ops") public static native Node Const(@Const @ByRef TensorProto proto, @Const @ByRef GraphDefBuilder.Options options); // TODO(josh11b): Support other types (e.g. quantized ints, float16). // namespace ops // namespace tensorflow // #endif // TENSORFLOW_CC_OPS_CONST_OP_H_ // Parsed from tensorflow/cc/ops/cc_op_gen.h /* Copyright 2015 Google Inc. 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_CC_OPS_CC_OP_GEN_H_ // #define TENSORFLOW_CC_OPS_CC_OP_GEN_H_ // #include "tensorflow/core/framework/op_def.pb.h" // Result is written to files dot_h and dot_cc. @Namespace("tensorflow") public static native void WriteCCOps(@Const @ByRef OpList ops, @StdString BytePointer dot_h_fname, @StdString BytePointer dot_cc_fname); @Namespace("tensorflow") public static native void WriteCCOps(@Const @ByRef OpList ops, @StdString String dot_h_fname, @StdString String dot_cc_fname); // namespace tensorflow // #endif // TENSORFLOW_CC_OPS_CC_OP_GEN_H_ // Parsed from tensorflow/cc/ops/array_ops.h // This file is MACHINE GENERATED! Do not edit. // #ifndef TENSORFLOW_CC_OPS_ARRAY_OPS_H_ // #define TENSORFLOW_CC_OPS_ARRAY_OPS_H_ // #include "tensorflow/core/framework/tensor.h" // #include "tensorflow/core/framework/tensor_shape.h" // #include "tensorflow/core/framework/types.h" // #include "tensorflow/core/graph/graph_def_builder.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // These add a node to the graph from opts. // // Note for "NodeOut" inputs, you will typically either pass // * a {Node*, int index} (to pass the index-th output of that node), or // * a Node* (to pass the first output of that node). // Returns a batched diagonal tensor with a given batched diagonal values. // // Given a `diagonal`, this operation returns a tensor with the `diagonal` and // everything else padded with zeros. The diagonal is computed as follows: // // Assume `diagonal` has `k` dimensions `[I, J, K, ..., N]`, then the output is a // tensor of rank `k+1` with dimensions [I, J, K, ..., N, N]` where: // // `output[i, j, k, ..., m, n] = 1{m=n} * diagonal[i, j, k, ..., n]`. // // For example: // // ```prettyprint // # 'diagonal' is [[1, 2, 3, 4], [5, 6, 7, 8]] // // and diagonal.shape = (2, 4) // // tf.batch_matrix_diag(diagonal) ==> [[[1, 0, 0, 0] // [0, 2, 0, 0] // [0, 0, 3, 0] // [0, 0, 0, 4]], // [[5, 0, 0, 0] // [0, 6, 0, 0] // [0, 0, 7, 0] // [0, 0, 0, 8]]] // // which has shape (2, 4, 4) // ``` // // Arguments: // * diagonal: Rank `k`, where `k >= 1`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Rank `k+1`, with `output.shape = diagonal.shape + [diagonal.shape[-1]]`. @Namespace("tensorflow::ops") public static native Node BatchMatrixDiag(@ByVal NodeBuilder.NodeOut diagonal, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BatchMatrixDiag(Node diagonal, @Const @ByRef GraphDefBuilder.Options opts); // Returns the batched diagonal part of a batched tensor. // // This operation returns a tensor with the `diagonal` part // of the batched `input`. The `diagonal` part is computed as follows: // // Assume `input` has `k` dimensions `[I, J, K, ..., N, N]`, then the output is a // tensor of rank `k - 1` with dimensions `[I, J, K, ..., N]` where: // // `diagonal[i, j, k, ..., n] = input[i, j, k, ..., n, n]`. // // The input must be at least a matrix. // // For example: // // ```prettyprint // # 'input' is [[[1, 0, 0, 0] // [0, 2, 0, 0] // [0, 0, 3, 0] // [0, 0, 0, 4]], // [[5, 0, 0, 0] // [0, 6, 0, 0] // [0, 0, 7, 0] // [0, 0, 0, 8]]] // // and input.shape = (2, 4, 4) // // tf.batch_matrix_diag_part(input) ==> [[1, 2, 3, 4], [5, 6, 7, 8]] // // which has shape (2, 4) // ``` // // Arguments: // * input: Rank `k` tensor where `k >= 2` and the last two dimensions are equal. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The extracted diagonal(s) having shape // `diagonal.shape = input.shape[:-1]`. @Namespace("tensorflow::ops") public static native Node BatchMatrixDiagPart(@ByVal NodeBuilder.NodeOut input, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BatchMatrixDiagPart(Node input, @Const @ByRef GraphDefBuilder.Options opts); // Bitcasts a tensor from one type to another without copying data. // // Given a tensor `input`, this operation returns a tensor that has the same buffer // data as `input` with datatype `type`. // // If the input datatype `T` is larger than the output datatype `type` then the // shape changes from [...] to [..., sizeof(`T`)/sizeof(`type`)]. // // If `T` is smaller than `type`, the operator requires that the rightmost // dimension be equal to sizeof(`type`)/sizeof(`T`). The shape then goes from // [..., sizeof(`type`)/sizeof(`T`)] to [...]. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Bitcast(@ByVal NodeBuilder.NodeOut input, @Cast("tensorflow::DataType") int type, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Bitcast(Node input, @Cast("tensorflow::DataType") int type, @Const @ByRef GraphDefBuilder.Options opts); // Return the reduction indices for computing gradients of s0 op s1 with broadcast. // // This is typically used by gradient computations for a broadcasting operation. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * r0 // * r1 @Namespace("tensorflow::ops") public static native Node BroadcastGradientArgs(@ByVal NodeBuilder.NodeOut s0, @ByVal NodeBuilder.NodeOut s1, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BroadcastGradientArgs(Node s0, Node s1, @Const @ByRef GraphDefBuilder.Options opts); // Checks a tensor for NaN and Inf values. // // When run, reports an `InvalidArgument` error if `tensor` has any values // that are not a number (NaN) or infinity (Inf). Otherwise, passes `tensor` as-is. // // Arguments: // * message: Prefix of the error message. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node CheckNumerics(@ByVal NodeBuilder.NodeOut tensor, @StringPiece BytePointer message, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node CheckNumerics(Node tensor, @StringPiece String message, @Const @ByRef GraphDefBuilder.Options opts); // Concatenates tensors along one dimension. // // Arguments: // * concat_dim: 0-D. The dimension along which to concatenate. Must be in the // range [0, rank(values)). // * values: The `N` Tensors to concatenate. Their ranks and types must match, // and their sizes must match in all dimensions except `concat_dim`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A `Tensor` with the concatenation of values stacked along the // `concat_dim` dimension. This tensor's shape matches that of `values` except // in `concat_dim` where it has the sum of the sizes. @Namespace("tensorflow::ops") public static native Node Concat(@ByVal NodeBuilder.NodeOut concat_dim, @ByVal NodeOutVector values, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Concat(Node concat_dim, @ByVal NodeOutVector values, @Const @ByRef GraphDefBuilder.Options opts); // Computes offsets of concat inputs within its output. // // For example: // // ```prettyprint // # 'x' is [2, 2, 7] // # 'y' is [2, 3, 7] // # 'z' is [2, 5, 7] // concat_offset(2, [x, y, z]) => [0, 0, 0], [0, 2, 0], [0, 5, 0] // ``` // // Arguments: // * concat_dim: The dimension along which to concatenate. // * shape: The `N` int32 vectors representing shape of tensors being concatenated. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node ConcatOffset(@ByVal NodeBuilder.NodeOut concat_dim, @ByVal NodeOutVector shape, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ConcatOffset(Node concat_dim, @ByVal NodeOutVector shape, @Const @ByRef GraphDefBuilder.Options opts); // Returns a constant tensor. // // Arguments: // * value: Attr `value` is the tensor to return. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Const(@Const @ByRef Tensor value, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); // DepthToSpace for tensors of type T. // // Rearranges data from depth into blocks of spatial data. // This is the reverse transformation of SpaceToDepth. More specifically, // this op outputs a copy of the input tensor where values from the `depth` // dimension are moved in spatial blocks to the `height` and `width` dimensions. // The attr `block_size` indicates the input block size and how the data is moved. // // * Chunks of data of size `block_size * block_size` from depth are rearranged // into non-overlapping blocks of size `block_size x block_size` // * The width the output tensor is `input_depth * block_size`, whereas the // height is `input_height * block_size`. // * The depth of the input tensor must be divisible by // `block_size * block_size`. // // That is, assuming the input is in the shape: // `[batch, height, width, depth]`, // the shape of the output will be: // `[batch, height*block_size, width*block_size, depth/(block_size*block_size)]` // // This operation requires that the input tensor be of rank 4, and that // `block_size` be >=1 and that `block_size * block_size` be a divisor of the // input depth. // // This operation is useful for resizing the activations between convolutions // (but keeping all data), e.g. instead of pooling. It is also useful for training // purely convolutional models. // // For example, given this input of shape `[1, 1, 1, 4]`, and a block size of 2: // // ```prettyprint // x = [[[[1, 2, 3, 4]]]] // // ``` // // This operation will output a tensor of shape `[1, 2, 2, 1]`: // // ```prettyprint // [[[[1], [2]], // [[3], [4]]]] // ``` // // Here, the input has a batch of 1 and each batch element has shape `[1, 1, 4]`, // the corresponding output will have 2x2 elements and will have a depth of // 1 channel (1 = `4 / (block_size * block_size)`). // The output element shape is `[2, 2, 1]`. // // For an input tensor with larger depth, here of shape `[1, 1, 1, 12]`, e.g. // // ```prettyprint // x = [[[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]]]] // ``` // // This operation, for block size of 2, will return the following tensor of shape // `[1, 2, 2, 3]` // // ```prettyprint // [[[[1, 2, 3], [4, 5, 6]], // [[7, 8, 9], [10, 11, 12]]]] // // ``` // // Similarly, for the following input of shape `[1 2 2 4]`, and a block size of 2: // // ```prettyprint // x = [[[[1, 2, 3, 4], // [5, 6, 7, 8]], // [[9, 10, 11, 12], // [13, 14, 15, 16]]]] // ``` // // the operator will return the following tensor of shape `[1 4 4 1]`: // // ```prettyprint // x = [[ [1], [2], [5], [6]], // [ [3], [4], [7], [8]], // [ [9], [10], [13], [14]], // [ [11], [12], [15], [16]]] // // ``` // // Arguments: // * block_size: The size of the spatial block, same as in Space2Depth. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node DepthToSpace(@ByVal NodeBuilder.NodeOut input, @Cast("tensorflow::int64") long block_size, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DepthToSpace(Node input, @Cast("tensorflow::int64") long block_size, @Const @ByRef GraphDefBuilder.Options opts); // Returns a diagonal tensor with a given diagonal values. // // Given a `diagonal`, this operation returns a tensor with the `diagonal` and // everything else padded with zeros. The diagonal is computed as follows: // // Assume `diagonal` has dimensions [D1,..., Dk], then the output is a tensor of // rank 2k with dimensions [D1,..., Dk, D1,..., Dk] where: // // `output[i1,..., ik, i1,..., ik] = diagonal[i1, ..., ik]` and 0 everywhere else. // // For example: // // ```prettyprint // # 'diagonal' is [1, 2, 3, 4] // tf.diag(diagonal) ==> [[1, 0, 0, 0] // [0, 2, 0, 0] // [0, 0, 3, 0] // [0, 0, 0, 4]] // ``` // // Arguments: // * diagonal: Rank k tensor where k is at most 3. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Diag(@ByVal NodeBuilder.NodeOut diagonal, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Diag(Node diagonal, @Const @ByRef GraphDefBuilder.Options opts); // Returns the diagonal part of the tensor. // // This operation returns a tensor with the `diagonal` part // of the `input`. The `diagonal` part is computed as follows: // // Assume `input` has dimensions `[D1,..., Dk, D1,..., Dk]`, then the output is a // tensor of rank `k` with dimensions `[D1,..., Dk]` where: // // `diagonal[i1,..., ik] = input[i1, ..., ik, i1,..., ik]`. // // For example: // // ```prettyprint // # 'input' is [[1, 0, 0, 0] // [0, 2, 0, 0] // [0, 0, 3, 0] // [0, 0, 0, 4]] // // tf.diag_part(input) ==> [1, 2, 3, 4] // ``` // // Arguments: // * input: Rank k tensor where k is 2, 4, or 6. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The extracted diagonal. @Namespace("tensorflow::ops") public static native Node DiagPart(@ByVal NodeBuilder.NodeOut input, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DiagPart(Node input, @Const @ByRef GraphDefBuilder.Options opts); // Computes the (possibly normalized) Levenshtein Edit Distance. // // The inputs are variable-length sequences provided by SparseTensors // (hypothesis_indices, hypothesis_values, hypothesis_shape) // and // (truth_indices, truth_values, truth_shape). // // The inputs are: // // Arguments: // * hypothesis_indices: The indices of the hypothesis list SparseTensor. // This is an N x R int64 matrix. // * hypothesis_values: The values of the hypothesis list SparseTensor. // This is an N-length vector. // * hypothesis_shape: The shape of the hypothesis list SparseTensor. // This is an R-length vector. // * truth_indices: The indices of the truth list SparseTensor. // This is an M x R int64 matrix. // * truth_values: The values of the truth list SparseTensor. // This is an M-length vector. // * truth_shape: truth indices, vector. // * opts: // .WithAttr("normalize", bool): Defaults to true. // boolean (if true, edit distances are normalized by length of truth). // // The output is: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A dense float tensor with rank R - 1. // // For the example input: // // // hypothesis represents a 2x1 matrix with variable-length values: // // (0,0) = ["a"] // // (1,0) = ["b"] // hypothesis_indices = [[0, 0, 0], // [1, 0, 0]] // hypothesis_values = ["a", "b"] // hypothesis_shape = [2, 1, 1] // // // truth represents a 2x2 matrix with variable-length values: // // (0,0) = [] // // (0,1) = ["a"] // // (1,0) = ["b", "c"] // // (1,1) = ["a"] // truth_indices = [[0, 1, 0], // [1, 0, 0], // [1, 0, 1], // [1, 1, 0]] // truth_values = ["a", "b", "c", "a"] // truth_shape = [2, 2, 2] // normalize = true // // The output will be: // // // output is a 2x2 matrix with edit distances normalized by truth lengths. // output = [[inf, 1.0], // (0,0): no truth, (0,1): no hypothesis // [0.5, 1.0]] // (1,0): addition, (1,1): no hypothesis @Namespace("tensorflow::ops") public static native Node EditDistance(@ByVal NodeBuilder.NodeOut hypothesis_indices, @ByVal NodeBuilder.NodeOut hypothesis_values, @ByVal NodeBuilder.NodeOut hypothesis_shape, @ByVal NodeBuilder.NodeOut truth_indices, @ByVal NodeBuilder.NodeOut truth_values, @ByVal NodeBuilder.NodeOut truth_shape, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node EditDistance(Node hypothesis_indices, Node hypothesis_values, Node hypothesis_shape, Node truth_indices, Node truth_values, Node truth_shape, @Const @ByRef GraphDefBuilder.Options opts); // Inserts a dimension of 1 into a tensor's shape. // // Given a tensor `input`, this operation inserts a dimension of 1 at the // dimension index `dim` of `input`'s shape. The dimension index `dim` starts at // zero; if you specify a negative number for `dim` it is counted backward from // the end. // // This operation is useful if you want to add a batch dimension to a single // element. For example, if you have a single image of shape `[height, width, // channels]`, you can make it a batch of 1 image with `expand_dims(image, 0)`, // which will make the shape `[1, height, width, channels]`. // // Other examples: // // ```prettyprint // # 't' is a tensor of shape [2] // shape(expand_dims(t, 0)) ==> [1, 2] // shape(expand_dims(t, 1)) ==> [2, 1] // shape(expand_dims(t, -1)) ==> [2, 1] // // # 't2' is a tensor of shape [2, 3, 5] // shape(expand_dims(t2, 0)) ==> [1, 2, 3, 5] // shape(expand_dims(t2, 2)) ==> [2, 3, 1, 5] // shape(expand_dims(t2, 3)) ==> [2, 3, 5, 1] // ``` // // This operation requires that: // // `-1-input.dims() <= dim <= input.dims()` // // This operation is related to `squeeze()`, which removes dimensions of // size 1. // // Arguments: // * dim: 0-D (scalar). Specifies the dimension index at which to // expand the shape of `input`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Contains the same data as `input`, but its shape has an additional // dimension of size 1 added. @Namespace("tensorflow::ops") public static native Node ExpandDims(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut dim, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ExpandDims(Node input, Node dim, @Const @ByRef GraphDefBuilder.Options opts); // Creates a tensor filled with a scalar value. // // This operation creates a tensor of shape `dims` and fills it with `value`. // // For example: // // ```prettyprint // # Output tensor has shape [2, 3]. // fill([2, 3], 9) ==> [[9, 9, 9] // [9, 9, 9]] // ``` // // Arguments: // * dims: 1-D. Represents the shape of the output tensor. // * value: 0-D (scalar). Value to fill the returned tensor. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Fill(@ByVal NodeBuilder.NodeOut dims, @ByVal NodeBuilder.NodeOut value, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Fill(Node dims, Node value, @Const @ByRef GraphDefBuilder.Options opts); // Gather slices from `params` according to `indices`. // // `indices` must be an integer tensor of any dimension (usually 0-D or 1-D). // Produces an output tensor with shape `indices.shape + params.shape[1:]` where: // // # Scalar indices // output[:, ..., :] = params[indices, :, ... :] // // # Vector indices // output[i, :, ..., :] = params[indices[i], :, ... :] // // # Higher rank indices // output[i, ..., j, :, ... :] = params[indices[i, ..., j], :, ..., :] // // If `indices` is a permutation and `len(indices) == params.shape[0]` then // this operation will permute `params` accordingly. // //
// //
// // Arguments: // * opts: // .WithAttr("validate_indices", bool): Defaults to true. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Gather(@ByVal NodeBuilder.NodeOut params, @ByVal NodeBuilder.NodeOut indices, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Gather(Node params, Node indices, @Const @ByRef GraphDefBuilder.Options opts); // Gather values from `params` according to `indices`. // // `indices` must be integer tensor, containing indices into `params`. // It must be shape `[d_0, ..., d_N, R]` where `R` is the rank of `params`. // The innermost dimension of `indices` (with length `R`) corresponds to the // indices of `params`. // // Produces an output tensor with shape `[d_0, ..., d_{n-1}]` where: // // output[i, j, k, ...] = params[indices[i, j, k, ..., :]] // // e.g. for `indices` a matrix: // // output[i] = params[indices[i, :]] // // Arguments: // * params: R-D. The tensor from which to gather values. // * indices: (N+1)-D. Index tensor having shape `[d_0, ..., d_N, R]`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // N-D. Values from `params` gathered from indices given by `indices`. @Namespace("tensorflow::ops") public static native Node GatherNd(@ByVal NodeBuilder.NodeOut params, @ByVal NodeBuilder.NodeOut indices, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node GatherNd(Node params, Node indices, @Const @ByRef GraphDefBuilder.Options opts); // Return a tensor with the same shape and contents as the input tensor or value. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Identity(@ByVal NodeBuilder.NodeOut input, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Identity(Node input, @Const @ByRef GraphDefBuilder.Options opts); // Returns immutable tensor from memory region. // // The current implementation memmaps the tensor from a file. // // Arguments: // * dtype: Type of the returned tensor. // * shape: Shape of the returned tensor. // * memory_region_name: Name of readonly memory region used by the tensor, see // NewReadOnlyMemoryRegionFromFile in tensorflow::Env. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node ImmutableConst(@Cast("tensorflow::DataType") int dtype, @ByVal TensorShape shape, @StringPiece BytePointer memory_region_name, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ImmutableConst(@Cast("tensorflow::DataType") int dtype, @ByVal TensorShape shape, @StringPiece String memory_region_name, @Const @ByRef GraphDefBuilder.Options opts); // Computes the inverse permutation of a tensor. // // This operation computes the inverse of an index permutation. It takes a 1-D // integer tensor `x`, which represents the indices of a zero-based array, and // swaps each value with its index position. In other words, for an output tensor // `y` and an input tensor `x`, this operation computes the following: // // `y[x[i]] = i for i in [0, 1, ..., len(x) - 1]` // // The values must include 0. There can be no duplicate values or negative values. // // For example: // // ```prettyprint // # tensor `x` is [3, 4, 0, 2, 1] // invert_permutation(x) ==> [2, 4, 3, 0, 1] // ``` // // Arguments: // * x: 1-D. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 1-D. @Namespace("tensorflow::ops") public static native Node InvertPermutation(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node InvertPermutation(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Computes the difference between two lists of numbers or strings. // // Given a list `x` and a list `y`, this operation returns a list `out` that // represents all values that are in `x` but not in `y`. The returned list `out` // is sorted in the same order that the numbers appear in `x` (duplicates are // preserved). This operation also returns a list `idx` that represents the // position of each `out` element in `x`. In other words: // // `out[i] = x[idx[i]] for i in [0, 1, ..., len(out) - 1]` // // For example, given this input: // // ```prettyprint // x = [1, 2, 3, 4, 5, 6] // y = [1, 3, 5] // ``` // // This operation would return: // // ```prettyprint // out ==> [2, 4, 6] // idx ==> [1, 3, 5] // ``` // // Arguments: // * x: 1-D. Values to keep. // * y: 1-D. Values to remove. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * out: 1-D. Values present in `x` but not in `y`. // * idx: 1-D. Positions of `x` values preserved in `out`. @Namespace("tensorflow::ops") public static native Node ListDiff(@ByVal NodeBuilder.NodeOut x, @ByVal NodeBuilder.NodeOut y, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ListDiff(Node x, Node y, @Const @ByRef GraphDefBuilder.Options opts); // Pads a tensor with mirrored values. // // This operation pads a `input` with mirrored values according to the `paddings` // you specify. `paddings` is an integer tensor with shape `[n, 2]`, where n is // the rank of `input`. For each dimension D of `input`, `paddings[D, 0]` indicates // how many values to add before the contents of `input` in that dimension, and // `paddings[D, 1]` indicates how many values to add after the contents of `input` // in that dimension. Both `paddings[D, 0]` and `paddings[D, 1]` must be no greater // than `input.dim_size(D)` (or `input.dim_size(D) - 1`) if `copy_border` is true // (if false, respectively). // // The padded size of each dimension D of the output is: // // `paddings(D, 0) + input.dim_size(D) + paddings(D, 1)` // // For example: // // ```prettyprint // # 't' is [[1, 2, 3], [4, 5, 6]]. // # 'paddings' is [[1, 1]], [2, 2]]. // # 'mode' is SYMMETRIC. // # rank of 't' is 2. // pad(t, paddings) ==> [[2, 1, 1, 2, 3, 3, 2] // [2, 1, 1, 2, 3, 3, 2] // [5, 4, 4, 5, 6, 6, 5] // [5, 4, 4, 5, 6, 6, 5]] // ``` // // Arguments: // * input: The input tensor to be padded. // * paddings: A two-column matrix specifying the padding sizes. The number of // rows must be the same as the rank of `input`. // * mode: Either `REFLECT` or `SYMMETRIC`. In reflect mode the padded regions // do not include the borders, while in symmetric mode the padded regions // do include the borders. For example, if `input` is `[1, 2, 3]` and `paddings` // is `[0, 2]`, then the output is `[1, 2, 3, 2, 1]` in reflect mode, and // it is `[1, 2, 3, 3, 2]` in symmetric mode. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The padded tensor. @Namespace("tensorflow::ops") public static native Node MirrorPad(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut paddings, @StringPiece BytePointer mode, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MirrorPad(Node input, Node paddings, @StringPiece String mode, @Const @ByRef GraphDefBuilder.Options opts); // Gradient op for `MirrorPad` op. This op folds a mirror-padded tensor. // // This operation folds the padded areas of `input` by `MirrorPad` according to the // `paddings` you specify. `paddings` must be the same as `paddings` argument // given to the corresponding `MirrorPad` op. // // The folded size of each dimension D of the output is: // // `input.dim_size(D) - paddings(D, 0) - paddings(D, 1)` // // For example: // // ```prettyprint // # 't' is [[1, 2, 3], [4, 5, 6], [7, 8, 9]]. // # 'paddings' is [[0, 1]], [0, 1]]. // # 'mode' is SYMMETRIC. // # rank of 't' is 2. // pad(t, paddings) ==> [[ 1, 5] // [11, 28]] // ``` // // Arguments: // * input: The input tensor to be folded. // * paddings: A two-column matrix specifying the padding sizes. The number of // rows must be the same as the rank of `input`. // * mode: The mode used in the `MirrorPad` op. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The folded tensor. @Namespace("tensorflow::ops") public static native Node MirrorPadGrad(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut paddings, @StringPiece BytePointer mode, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MirrorPadGrad(Node input, Node paddings, @StringPiece String mode, @Const @ByRef GraphDefBuilder.Options opts); // Returns a one-hot tensor. // // The locations represented by indices in `indices` take value `on_value`, // while all other locations take value `off_value`. // // If the input `indices` is rank `N`, the output will have rank `N+1`, // The new axis is created at dimension `axis` (default: the new axis is // appended at the end). // // If `indices` is a scalar the output shape will be a vector of length `depth`. // // If `indices` is a vector of length `features`, the output shape will be: // ``` // features x depth if axis == -1 // depth x features if axis == 0 // ``` // // If `indices` is a matrix (batch) with shape `[batch, features]`, // the output shape will be: // ``` // batch x features x depth if axis == -1 // batch x depth x features if axis == 1 // depth x batch x features if axis == 0 // ``` // // // Examples // ========= // // Suppose that // // ``` // indices = [0, 2, -1, 1] // depth = 3 // on_value = 5.0 // off_value = 0.0 // axis = -1 // ``` // // Then output is `[4 x 3]`: // // ```output = // [5.0 0.0 0.0] // one_hot(0) // [0.0 0.0 5.0] // one_hot(2) // [0.0 0.0 0.0] // one_hot(-1) // [0.0 5.0 0.0] // one_hot(1) // ``` // // Suppose that // // ``` // indices = [0, 2, -1, 1] // depth = 3 // on_value = 0.0 // off_value = 3.0 // axis = 0 // ``` // // Then output is `[3 x 4]`: // // ```output = // [0.0 3.0 3.0 3.0] // [3.0 3.0 3.0 0.0] // [3.0 3.0 3.0 3.0] // [3.0 0.0 3.0 3.0] // // ^ one_hot(0) // // ^ one_hot(2) // // ^ one_hot(-1) // // ^ one_hot(1) // ``` // Suppose that // // ``` // indices = [[0, 2], [1, -1]] // depth = 3 // on_value = 1.0 // off_value = 0.0 // axis = -1 // ``` // // Then output is `[2 x 2 x 3]`: // // ```output = // [ // [1.0, 0.0, 0.0] // one_hot(0) // [0.0, 0.0, 1.0] // one_hot(2) // ][ // [0.0, 1.0, 0.0] // one_hot(1) // [0.0, 0.0, 0.0] // one_hot(-1) // ]``` // // Arguments: // * indices: A tensor of indices. // * depth: A scalar defining the depth of the one hot dimension. // * on_value: A scalar defining the value to fill in output when `indices[j] = i`. // * off_value: A scalar defining the value to fill in output when `indices[j] != i`. // * opts: // .WithAttr("axis", int64): Defaults to -1. // The axis to fill (default: -1, a new inner-most axis). // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The one-hot tensor. @Namespace("tensorflow::ops") public static native Node OneHot(@ByVal NodeBuilder.NodeOut indices, @ByVal NodeBuilder.NodeOut depth, @ByVal NodeBuilder.NodeOut on_value, @ByVal NodeBuilder.NodeOut off_value, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node OneHot(Node indices, Node depth, Node on_value, Node off_value, @Const @ByRef GraphDefBuilder.Options opts); // Packs a list of `N` rank-`R` tensors into one rank-`(R+1)` tensor. // // Packs the `N` tensors in `values` into a tensor with rank one higher than each // tensor in `values` and shape `[N] + values[0].shape`. The output satisfies // `output[i, ...] = values[i][...]`. // // This is the opposite of `unpack`. // // Arguments: // * values: Must be of same shape and type. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The packed tensor. @Namespace("tensorflow::ops") public static native Node Pack(@ByVal NodeOutVector values, @Const @ByRef GraphDefBuilder.Options opts); // Pads a tensor with zeros. // // This operation pads a `input` with zeros according to the `paddings` you // specify. `paddings` is an integer tensor with shape `[Dn, 2]`, where n is the // rank of `input`. For each dimension D of `input`, `paddings[D, 0]` indicates // how many zeros to add before the contents of `input` in that dimension, and // `paddings[D, 1]` indicates how many zeros to add after the contents of `input` // in that dimension. // // The padded size of each dimension D of the output is: // // `paddings(D, 0) + input.dim_size(D) + paddings(D, 1)` // // For example: // // ```prettyprint // # 't' is [[1, 1], [2, 2]] // # 'paddings' is [[1, 1], [2, 2]] // # rank of 't' is 2 // pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0] // [0, 0, 1, 1, 0, 0] // [0, 0, 2, 2, 0, 0] // [0, 0, 0, 0, 0, 0]] // ``` // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Pad(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut paddings, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Pad(Node input, Node paddings, @Const @ByRef GraphDefBuilder.Options opts); // A placeholder op for a value that will be fed into the computation. // // N.B. This operation will fail with an error if it is executed. It is // intended as a way to represent a value that will always be fed, and to // provide attrs that enable the fed value to be checked at runtime. // // Arguments: // * dtype: The type of elements in the tensor. // * opts: // .WithAttr("shape", TensorShape): Defaults to []. // (Optional) The shape of the tensor. If the shape has 0 dimensions, the // shape is unconstrained. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A placeholder tensor that must be replaced using the feed mechanism. @Namespace("tensorflow::ops") public static native Node Placeholder(@Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); // A placeholder op that passes though `input` when its output is not fed. // // Arguments: // * input: The default value to produce when `output` is not fed. // * shape: The (possibly partial) shape of the tensor. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A placeholder tensor that defaults to `input` if it is not fed. @Namespace("tensorflow::ops") public static native Node PlaceholderWithDefault(@ByVal NodeBuilder.NodeOut input, @ByVal TensorShape shape, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node PlaceholderWithDefault(Node input, @ByVal TensorShape shape, @Const @ByRef GraphDefBuilder.Options opts); // Returns the rank of a tensor. // // This operation returns an integer representing the rank of `input`. // // For example: // // ```prettyprint // # 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]] // # shape of tensor 't' is [2, 2, 3] // rank(t) ==> 3 // ``` // // **Note**: The rank of a tensor is not the same as the rank of a matrix. The rank // of a tensor is the number of indices required to uniquely select each element // of the tensor. Rank is also known as "order", "degree", or "ndims." // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Rank(@ByVal NodeBuilder.NodeOut input, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Rank(Node input, @Const @ByRef GraphDefBuilder.Options opts); // Return the same ref tensor as the input ref tensor. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node RefIdentity(@ByVal NodeBuilder.NodeOut input, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node RefIdentity(Node input, @Const @ByRef GraphDefBuilder.Options opts); // Reshapes a tensor. // // Given `tensor`, this operation returns a tensor that has the same values // as `tensor` with shape `shape`. // // If one component of `shape` is the special value -1, the size of that dimension // is computed so that the total size remains constant. In particular, a `shape` // of `[-1]` flattens into 1-D. At most one component of `shape` can be -1. // // If `shape` is 1-D or higher, then the operation returns a tensor with shape // `shape` filled with the values of `tensor`. In this case, the number of elements // implied by `shape` must be the same as the number of elements in `tensor`. // // For example: // // ```prettyprint // # tensor 't' is [1, 2, 3, 4, 5, 6, 7, 8, 9] // # tensor 't' has shape [9] // reshape(t, [3, 3]) ==> [[1, 2, 3] // [4, 5, 6] // [7, 8, 9]] // // # tensor 't' is [[[1, 1], [2, 2]] // # [[3, 3], [4, 4]]] // # tensor 't' has shape [2, 2, 2] // reshape(t, [2, 4]) ==> [[1, 1, 2, 2] // [3, 3, 4, 4]] // // # tensor 't' is [[[1, 1, 1], // # [2, 2, 2]], // # [[3, 3, 3], // # [4, 4, 4]], // # [[5, 5, 5], // # [6, 6, 6]]] // # tensor 't' has shape [3, 2, 3] // # pass '[-1]' to flatten 't' // reshape(t, [-1]) ==> [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6] // # -1 can also be used with higher dimensional shapes // reshape(t, [2, -1]) ==> [[1, 1, 1, 2, 2, 2, 3, 3, 3], // [4, 4, 4, 5, 5, 5, 6, 6, 6]] // // # tensor 't' is [7] // # shape `[]` reshapes to a scalar // reshape(t, []) ==> 7 // ``` // // Arguments: // * shape: Defines the shape of the output tensor. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Reshape(@ByVal NodeBuilder.NodeOut tensor, @ByVal NodeBuilder.NodeOut shape, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Reshape(Node tensor, Node shape, @Const @ByRef GraphDefBuilder.Options opts); // Reverses specific dimensions of a tensor. // // Given a `tensor`, and a `bool` tensor `dims` representing the dimensions // of `tensor`, this operation reverses each dimension i of `tensor` where // `dims[i]` is `True`. // // `tensor` can have up to 8 dimensions. The number of dimensions // of `tensor` must equal the number of elements in `dims`. In other words: // // `rank(tensor) = size(dims)` // // For example: // // ```prettyprint // # tensor 't' is [[[[ 0, 1, 2, 3], // # [ 4, 5, 6, 7], // # [ 8, 9, 10, 11]], // # [[12, 13, 14, 15], // # [16, 17, 18, 19], // # [20, 21, 22, 23]]]] // # tensor 't' shape is [1, 2, 3, 4] // // # 'dims' is [False, False, False, True] // reverse(t, dims) ==> [[[[ 3, 2, 1, 0], // [ 7, 6, 5, 4], // [ 11, 10, 9, 8]], // [[15, 14, 13, 12], // [19, 18, 17, 16], // [23, 22, 21, 20]]]] // // # 'dims' is [False, True, False, False] // reverse(t, dims) ==> [[[[12, 13, 14, 15], // [16, 17, 18, 19], // [20, 21, 22, 23] // [[ 0, 1, 2, 3], // [ 4, 5, 6, 7], // [ 8, 9, 10, 11]]]] // // # 'dims' is [False, False, True, False] // reverse(t, dims) ==> [[[[8, 9, 10, 11], // [4, 5, 6, 7], // [0, 1, 2, 3]] // [[20, 21, 22, 23], // [16, 17, 18, 19], // [12, 13, 14, 15]]]] // ``` // // Arguments: // * tensor: Up to 8-D. // * dims: 1-D. The dimensions to reverse. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The same shape as `tensor`. @Namespace("tensorflow::ops") public static native Node Reverse(@ByVal NodeBuilder.NodeOut tensor, @ByVal NodeBuilder.NodeOut dims, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Reverse(Node tensor, Node dims, @Const @ByRef GraphDefBuilder.Options opts); // Reverses variable length slices. // // This op first slices `input` along the dimension `batch_dim`, and for each // slice `i`, reverses the first `seq_lengths[i]` elements along // the dimension `seq_dim`. // // The elements of `seq_lengths` must obey `seq_lengths[i] < input.dims[seq_dim]`, // and `seq_lengths` must be a vector of length `input.dims[batch_dim]`. // // The output slice `i` along dimension `batch_dim` is then given by input // slice `i`, with the first `seq_lengths[i]` slices along dimension // `seq_dim` reversed. // // For example: // // ```prettyprint // # Given this: // batch_dim = 0 // seq_dim = 1 // input.dims = (4, 8, ...) // seq_lengths = [7, 2, 3, 5] // // # then slices of input are reversed on seq_dim, but only up to seq_lengths: // output[0, 0:7, :, ...] = input[0, 7:0:-1, :, ...] // output[1, 0:2, :, ...] = input[1, 2:0:-1, :, ...] // output[2, 0:3, :, ...] = input[2, 3:0:-1, :, ...] // output[3, 0:5, :, ...] = input[3, 5:0:-1, :, ...] // // # while entries past seq_lens are copied through: // output[0, 7:, :, ...] = input[0, 7:, :, ...] // output[1, 2:, :, ...] = input[1, 2:, :, ...] // output[2, 3:, :, ...] = input[2, 3:, :, ...] // output[3, 2:, :, ...] = input[3, 2:, :, ...] // ``` // // In contrast, if: // // ```prettyprint // # Given this: // batch_dim = 2 // seq_dim = 0 // input.dims = (8, ?, 4, ...) // seq_lengths = [7, 2, 3, 5] // // # then slices of input are reversed on seq_dim, but only up to seq_lengths: // output[0:7, :, 0, :, ...] = input[7:0:-1, :, 0, :, ...] // output[0:2, :, 1, :, ...] = input[2:0:-1, :, 1, :, ...] // output[0:3, :, 2, :, ...] = input[3:0:-1, :, 2, :, ...] // output[0:5, :, 3, :, ...] = input[5:0:-1, :, 3, :, ...] // // # while entries past seq_lens are copied through: // output[7:, :, 0, :, ...] = input[7:, :, 0, :, ...] // output[2:, :, 1, :, ...] = input[2:, :, 1, :, ...] // output[3:, :, 2, :, ...] = input[3:, :, 2, :, ...] // output[2:, :, 3, :, ...] = input[2:, :, 3, :, ...] // ``` // // Arguments: // * input: The input to reverse. // * seq_lengths: 1-D with length `input.dims(batch_dim)` and // `max(seq_lengths) < input.dims(seq_dim)` // * seq_dim: The dimension which is partially reversed. // * opts: // .WithAttr("batch_dim", int64): Defaults to 0. // The dimension along which reversal is performed. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The partially reversed input. It has the same shape as `input`. @Namespace("tensorflow::ops") public static native Node ReverseSequence(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut seq_lengths, @Cast("tensorflow::int64") long seq_dim, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ReverseSequence(Node input, Node seq_lengths, @Cast("tensorflow::int64") long seq_dim, @Const @ByRef GraphDefBuilder.Options opts); // Returns the shape of a tensor. // // This operation returns a 1-D integer tensor representing the shape of `input`. // // For example: // // ```prettyprint // # 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]] // shape(t) ==> [2, 2, 3] // ``` // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Shape(@ByVal NodeBuilder.NodeOut input, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Shape(Node input, @Const @ByRef GraphDefBuilder.Options opts); // Returns shape of tensors. // // This operation returns N 1-D integer tensors representing shape of `input[i]s`. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node ShapeN(@ByVal NodeOutVector input, @Const @ByRef GraphDefBuilder.Options opts); // Returns the size of a tensor. // // This operation returns an integer representing the number of elements in // `input`. // // For example: // // ```prettyprint // # 't' is [[[1, 1,, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]] // size(t) ==> 12 // ``` // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Size(@ByVal NodeBuilder.NodeOut input, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Size(Node input, @Const @ByRef GraphDefBuilder.Options opts); // Return a slice from 'input'. // // The output tensor is a tensor with dimensions described by 'size' // whose values are extracted from 'input' starting at the offsets in // 'begin'. // // *Requirements*: // 0 <= begin[i] <= begin[i] + size[i] <= Di for i in [0, n) // // Arguments: // * begin: begin[i] specifies the offset into the 'i'th dimension of // 'input' to slice from. // * size: size[i] specifies the number of elements of the 'i'th dimension // of 'input' to slice. If size[i] is -1, all remaining elements in dimension // i are included in the slice (i.e. this is equivalent to setting // size[i] = input.dim_size(i) - begin[i]). // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Slice(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut begin, @ByVal NodeBuilder.NodeOut size, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Slice(Node input, Node begin, Node size, @Const @ByRef GraphDefBuilder.Options opts); // SpaceToDepth for tensors of type T. // // Rearranges blocks of spatial data, into depth. More specifically, // this op outputs a copy of the input tensor where values from the `height` // and `width` dimensions are moved to the `depth` dimension. // The attr `block_size` indicates the input block size and how the data is moved. // // * Non-overlapping blocks of size `block_size x block size` are rearranged // into depth at each location. // * The depth of the output tensor is `input_depth * block_size * block_size`. // * The input tensor's height and width must be divisible by block_size. // // That is, assuming the input is in the shape: // `[batch, height, width, depth]`, // the shape of the output will be: // `[batch, height/block_size, width/block_size, depth*block_size*block_size]` // // This operation requires that the input tensor be of rank 4, and that // `block_size` be >=1 and a divisor of both the input `height` and `width`. // // This operation is useful for resizing the activations between convolutions // (but keeping all data), e.g. instead of pooling. It is also useful for training // purely convolutional models. // // For example, given this input of shape `[1, 2, 2, 1]`, and block_size of 2: // // ```prettyprint // x = [[[[1], [2]], // [[3], [4]]]] // ``` // // This operation will output a tensor of shape `[1, 1, 1, 4]`: // // ```prettyprint // [[[[1, 2, 3, 4]]]] // ``` // // Here, the input has a batch of 1 and each batch element has shape `[2, 2, 1]`, // the corresponding output will have a single element (i.e. width and height are // both 1) and will have a depth of 4 channels (1 * block_size * block_size). // The output element shape is `[1, 1, 4]`. // // For an input tensor with larger depth, here of shape `[1, 2, 2, 3]`, e.g. // // ```prettyprint // x = [[[[1, 2, 3], [4, 5, 6]], // [[7, 8, 9], [10, 11, 12]]]] // ``` // // This operation, for block_size of 2, will return the following tensor of shape // `[1, 1, 1, 12]` // // ```prettyprint // [[[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]]]] // ``` // // Similarly, for the following input of shape `[1 4 4 1]`, and a block size of 2: // // ```prettyprint // x = [[ [1], [2], [5], [6]], // [ [3], [4], [7], [8]], // [ [9], [10], [13], [14]], // [ [11], [12], [15], [16]]] // ``` // // the operator will return the following tensor of shape `[1 2 2 4]`: // // ```prettyprint // x = [[[[1, 2, 3, 4], // [5, 6, 7, 8]], // [[9, 10, 11, 12], // [13, 14, 15, 16]]]] // ``` // // Arguments: // * block_size: The size of the spatial block. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node SpaceToDepth(@ByVal NodeBuilder.NodeOut input, @Cast("tensorflow::int64") long block_size, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SpaceToDepth(Node input, @Cast("tensorflow::int64") long block_size, @Const @ByRef GraphDefBuilder.Options opts); // Splits a tensor into `num_split` tensors along one dimension. // // Arguments: // * split_dim: 0-D. The dimension along which to split. Must be in the range // `[0, rank(value))`. // * value: The tensor to split. // * num_split: The number of ways to split. Must evenly divide // `value.shape[split_dim]`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // They are identically shaped tensors, whose shape matches that of `value` // except along `split_dim`, where their sizes are // `values.shape[split_dim] / num_split`. @Namespace("tensorflow::ops") public static native Node Split(@ByVal NodeBuilder.NodeOut split_dim, @ByVal NodeBuilder.NodeOut value, @Cast("tensorflow::int64") long num_split, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Split(Node split_dim, Node value, @Cast("tensorflow::int64") long num_split, @Const @ByRef GraphDefBuilder.Options opts); // Removes dimensions of size 1 from the shape of a tensor. // // Given a tensor `input`, this operation returns a tensor of the same type with // all dimensions of size 1 removed. If you don't want to remove all size 1 // dimensions, you can remove specific size 1 dimensions by specifying // `squeeze_dims`. // // For example: // // ```prettyprint // # 't' is a tensor of shape [1, 2, 1, 3, 1, 1] // shape(squeeze(t)) ==> [2, 3] // ``` // // Or, to remove specific size 1 dimensions: // // ```prettyprint // # 't' is a tensor of shape [1, 2, 1, 3, 1, 1] // shape(squeeze(t, [2, 4])) ==> [1, 2, 3, 1] // ``` // // Arguments: // * input: The `input` to squeeze. // * opts: // .WithAttr("squeeze_dims", gtl::ArraySlice): Defaults to []. // If specified, only squeezes the dimensions listed. The dimension // index starts at 0. It is an error to squeeze a dimension that is not 1. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Contains the same data as `input`, but has one or more dimensions of // size 1 removed. @Namespace("tensorflow::ops") public static native Node Squeeze(@ByVal NodeBuilder.NodeOut input, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Squeeze(Node input, @Const @ByRef GraphDefBuilder.Options opts); // Stops gradient computation. // // When executed in a graph, this op outputs its input tensor as-is. // // When building ops to compute gradients, this op prevents the contribution of // its inputs to be taken into account. Normally, the gradient generator adds ops // to a graph to compute the derivatives of a specified 'loss' by recursively // finding out inputs that contributed to its computation. If you insert this op // in the graph it inputs are masked from the gradient generator. They are not // taken into account for computing gradients. // // This is useful any time you want to compute a value with TensorFlow but need // to pretend that the value was a constant. Some examples include: // // * The *EM* algorithm where the *M-step* should not involve backpropagation // through the output of the *E-step*. // * Contrastive divergence training of Boltzmann machines where, when // differentiating the energy function, the training must not backpropagate // through the graph that generated the samples from the model. // * Adversarial training, where no backprop should happen through the adversarial // example generation process. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node StopGradient(@ByVal NodeBuilder.NodeOut input, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node StopGradient(Node input, @Const @ByRef GraphDefBuilder.Options opts); // Constructs a tensor by tiling a given tensor. // // This operation creates a new tensor by replicating `input` `multiples` times. // The output tensor's i'th dimension has `input.dims(i) * multiples[i]` elements, // and the values of `input` are replicated `multiples[i]` times along the 'i'th // dimension. For example, tiling `[a b c d]` by `[2]` produces // `[a b c d a b c d]`. // // Arguments: // * input: 1-D or higher. // * multiples: 1-D. Length must be the same as the number of dimensions in `input` // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Tile(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut multiples, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Tile(Node input, Node multiples, @Const @ByRef GraphDefBuilder.Options opts); // Returns the gradient of `Tile`. // // Since `Tile` takes an input and repeats the input `multiples` times // along each dimension, `TileGrad` takes in `multiples` and aggregates // each repeated tile of `input` into `output`. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node TileGrad(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut multiples, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node TileGrad(Node input, Node multiples, @Const @ByRef GraphDefBuilder.Options opts); // Shuffle dimensions of x according to a permutation. // // The output `y` has the same rank as `x`. The shapes of `x` and `y` satisfy: // `y.shape[i] == x.shape[perm[i]] for i in [0, 1, ..., rank(x) - 1]` // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Transpose(@ByVal NodeBuilder.NodeOut x, @ByVal NodeBuilder.NodeOut perm, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Transpose(Node x, Node perm, @Const @ByRef GraphDefBuilder.Options opts); // Finds unique elements in a 1-D tensor. // // This operation returns a tensor `y` containing all of the unique elements of `x` // sorted in the same order that they occur in `x`. This operation also returns a // tensor `idx` the same size as `x` that contains the index of each value of `x` // in the unique output `y`. In other words: // // `y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]` // // For example: // // ```prettyprint // # tensor 'x' is [1, 1, 2, 4, 4, 4, 7, 8, 8] // y, idx = unique(x) // y ==> [1, 2, 4, 7, 8] // idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4] // ``` // // Arguments: // * x: 1-D. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * y: 1-D. // * idx: 1-D. @Namespace("tensorflow::ops") public static native Node Unique(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Unique(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Finds unique elements in a 1-D tensor. // // This operation returns a tensor `y` containing all of the unique elements of `x` // sorted in the same order that they occur in `x`. This operation also returns a // tensor `idx` the same size as `x` that contains the index of each value of `x` // in the unique output `y`. Finally, it returns a third tensor `count` that // contains the count of each element of `y` in `x`. In other words: // // `y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]` // // For example: // // ```prettyprint // # tensor 'x' is [1, 1, 2, 4, 4, 4, 7, 8, 8] // y, idx, count = unique_with_counts(x) // y ==> [1, 2, 4, 7, 8] // idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4] // count ==> [2, 1, 3, 1, 2] // ``` // // Arguments: // * x: 1-D. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * y: 1-D. // * idx: 1-D. // * count: 1-D. @Namespace("tensorflow::ops") public static native Node UniqueWithCounts(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node UniqueWithCounts(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Unpacks the outer dimension of a rank-`R` tensor into `num` rank-`(R-1)` tensors. // // Unpacks `num` tensors from `value` by chipping it along the first dimension. // The i'th tensor in `output` is the slice `value[i, ...]`. Each tensor in // `output` has shape `value.shape[1:]`. // // This is the opposite of `pack`. // // Arguments: // * value: 1-D or higher, with first dimension `num`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The list of tensors unpacked from `value`. @Namespace("tensorflow::ops") public static native Node Unpack(@ByVal NodeBuilder.NodeOut value, @Cast("tensorflow::int64") long num, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Unpack(Node value, @Cast("tensorflow::int64") long num, @Const @ByRef GraphDefBuilder.Options opts); // Returns locations of true values in a boolean tensor. // // This operation returns the coordinates of true elements in `input`. The // coordinates are returned in a 2-D tensor where the first dimension (rows) // represents the number of true elements, and the second dimension (columns) // represents the coordinates of the true elements. Keep in mind, the shape of // the output tensor can vary depending on how many true values there are in // `input`. Indices are output in row-major order. // // For example: // // ```prettyprint // # 'input' tensor is [[True, False] // # [True, False]] // # 'input' has two true values, so output has two coordinates. // # 'input' has rank of 2, so coordinates have two indices. // where(input) ==> [[0, 0], // [1, 0]] // // # `input` tensor is [[[True, False] // # [True, False]] // # [[False, True] // # [False, True]] // # [[False, False] // # [False, True]]] // # 'input' has 5 true values, so output has 5 coordinates. // # 'input' has rank of 3, so coordinates have three indices. // where(input) ==> [[0, 0, 0], // [0, 1, 0], // [1, 0, 1], // [1, 1, 1], // [2, 1, 1]] // ``` // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Where(@ByVal NodeBuilder.NodeOut input, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Where(Node input, @Const @ByRef GraphDefBuilder.Options opts); // Returns a tensor of zeros with the same shape and type as x. // // Arguments: // * x: a tensor of type T. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // a tensor of the same shape and type as x but filled with zeros. @Namespace("tensorflow::ops") public static native Node ZerosLike(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ZerosLike(Node x, @Const @ByRef GraphDefBuilder.Options opts); // namespace ops // namespace tensorflow // #endif // TENSORFLOW_CC_OPS_ARRAY_OPS_H_ // Parsed from tensorflow/cc/ops/data_flow_ops.h // This file is MACHINE GENERATED! Do not edit. // #ifndef TENSORFLOW_CC_OPS_DATA_FLOW_OPS_H_ // #define TENSORFLOW_CC_OPS_DATA_FLOW_OPS_H_ // #include "tensorflow/core/framework/tensor.h" // #include "tensorflow/core/framework/tensor_shape.h" // #include "tensorflow/core/framework/types.h" // #include "tensorflow/core/graph/graph_def_builder.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // These add a node to the graph from opts. // // Note for "NodeOut" inputs, you will typically either pass // * a {Node*, int index} (to pass the index-th output of that node), or // * a Node* (to pass the first output of that node). // Delete the tensor specified by its handle in the session. // // Arguments: // * handle: The handle for a tensor stored in the session state. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node DeleteSessionTensor(@ByVal NodeBuilder.NodeOut handle, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DeleteSessionTensor(Node handle, @Const @ByRef GraphDefBuilder.Options opts); // Partitions `data` into `num_partitions` tensors using indices from `partitions`. // // For each index tuple `js` of size `partitions.ndim`, the slice `data[js, ...]` // becomes part of `outputs[partitions[js]]`. The slices with `partitions[js] = i` // are placed in `outputs[i]` in lexicographic order of `js`, and the first // dimension of `outputs[i]` is the number of entries in `partitions` equal to `i`. // In detail, // // outputs[i].shape = [sum(partitions == i)] + data.shape[partitions.ndim:] // // outputs[i] = pack([data[js, ...] for js if partitions[js] == i]) // // `data.shape` must start with `partitions.shape`. // // For example: // // # Scalar partitions // partitions = 1 // num_partitions = 2 // data = [10, 20] // outputs[0] = [] # Empty with shape [0, 2] // outputs[1] = [[10, 20]] // // # Vector partitions // partitions = [0, 0, 1, 1, 0] // num_partitions = 2 // data = [10, 20, 30, 40, 50] // outputs[0] = [10, 20, 50] // outputs[1] = [30, 40] // //
// //
// // Arguments: // * partitions: Any shape. Indices in the range `[0, num_partitions)`. // * num_partitions: The number of partitions to output. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node DynamicPartition(@ByVal NodeBuilder.NodeOut data, @ByVal NodeBuilder.NodeOut partitions, @Cast("tensorflow::int64") long num_partitions, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DynamicPartition(Node data, Node partitions, @Cast("tensorflow::int64") long num_partitions, @Const @ByRef GraphDefBuilder.Options opts); // Interleave the values from the `data` tensors into a single tensor. // // Builds a merged tensor such that // // merged[indices[m][i, ..., j], ...] = data[m][i, ..., j, ...] // // For example, if each `indices[m]` is scalar or vector, we have // // # Scalar indices // merged[indices[m], ...] = data[m][...] // // # Vector indices // merged[indices[m][i], ...] = data[m][i, ...] // // Each `data[i].shape` must start with the corresponding `indices[i].shape`, // and the rest of `data[i].shape` must be constant w.r.t. `i`. That is, we // must have `data[i].shape = indices[i].shape + constant`. In terms of this // `constant`, the output shape is // // merged.shape = [max(indices)] + constant // // Values are merged in order, so if an index appears in both `indices[m][i]` and // `indices[n][j]` for `(m,i) < (n,j)` the slice `data[n][j]` will appear in the // merged result. // // For example: // // indices[0] = 6 // indices[1] = [4, 1] // indices[2] = [[5, 2], [0, 3]] // data[0] = [61, 62] // data[1] = [[41, 42], [11, 12]] // data[2] = [[[51, 52], [21, 22]], [[1, 2], [31, 32]]] // merged = [[1, 2], [11, 12], [21, 22], [31, 32], [41, 42], // [51, 52], [61, 62]] // //
// //
// // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node DynamicStitch(@ByVal NodeOutVector indices, @ByVal NodeOutVector data, @Const @ByRef GraphDefBuilder.Options opts); // A queue that produces elements in first-in first-out order. // // Arguments: // * component_types: The type of each component in a value. // * opts: // .WithAttr("shapes", gtl::ArraySlice): Defaults to []. // The shape of each component in a value. The length of this attr must // be either 0 or the same as the length of component_types. If the length of // this attr is 0, the shapes of queue elements are not constrained, and // only one element may be dequeued at a time. // .WithAttr("capacity", int64): Defaults to -1. // The upper bound on the number of elements in this queue. // Negative numbers mean no limit. // .WithAttr("container", StringPiece): Defaults to "". // If non-empty, this queue is placed in the given container. // Otherwise, a default container is used. // .WithAttr("shared_name", StringPiece): Defaults to "". // If non-empty, this queue will be shared under the given name // across multiple sessions. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The handle to the queue. @Namespace("tensorflow::ops") public static native Node FIFOQueue(@ByVal DataTypeVector component_types, @Const @ByRef GraphDefBuilder.Options opts); // Store the input tensor in the state of the current session. // // Arguments: // * value: The tensor to be stored. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The handle for the tensor stored in the session state. @Namespace("tensorflow::ops") public static native Node GetSessionHandle(@ByVal NodeBuilder.NodeOut value, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node GetSessionHandle(Node value, @Const @ByRef GraphDefBuilder.Options opts); // Get the value of the tensor specified by its handle. // // Arguments: // * handle: The handle for a tensor stored in the session state. // * dtype: The type of the output value. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The tensor for the given handle. @Namespace("tensorflow::ops") public static native Node GetSessionTensor(@ByVal NodeBuilder.NodeOut handle, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node GetSessionTensor(Node handle, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); // Creates a non-initialized hash table. // // This op creates a hash table, specifying the type of its keys and values. // Before using the table you will have to initialize it. After initialization the // table will be immutable. // // Arguments: // * key_dtype: Type of the table keys. // * value_dtype: Type of the table values. // * opts: // .WithAttr("container", StringPiece): Defaults to "". // If non-empty, this table is placed in the given container. // Otherwise, a default container is used. // .WithAttr("shared_name", StringPiece): Defaults to "". // If non-empty, this table is shared under the given name across // multiple sessions. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Handle to a table. @Namespace("tensorflow::ops") public static native Node HashTable(@Cast("tensorflow::DataType") int key_dtype, @Cast("tensorflow::DataType") int value_dtype, @Const @ByRef GraphDefBuilder.Options opts); // Table initializer that takes two tensors for keys and values respectively. // // Arguments: // * table_handle: Handle to a table which will be initialized. // * keys: Keys of type Tkey. // * values: Values of type Tval. Same shape as `keys`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node InitializeTable(@ByVal NodeBuilder.NodeOut table_handle, @ByVal NodeBuilder.NodeOut keys, @ByVal NodeBuilder.NodeOut values, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node InitializeTable(Node table_handle, Node keys, Node values, @Const @ByRef GraphDefBuilder.Options opts); // Looks up keys in a table, outputs the corresponding values. // // The tensor `keys` must of the same type as the keys of the table. // The output `values` is of the type of the table values. // // The scalar `default_value` is the value output for keys not present in the // table. It must also be of the same type as the table values. // // Arguments: // * table_handle: Handle to the table. // * keys: Any shape. Keys to look up. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Same shape as `keys`. Values found in the table, or `default_values` // for missing keys. @Namespace("tensorflow::ops") public static native Node LookupTableFind(@ByVal NodeBuilder.NodeOut table_handle, @ByVal NodeBuilder.NodeOut keys, @ByVal NodeBuilder.NodeOut default_value, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node LookupTableFind(Node table_handle, Node keys, Node default_value, @Const @ByRef GraphDefBuilder.Options opts); // Computes the number of elements in the given table. // // Arguments: // * table_handle: Handle to the table. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Scalar that contains number of elements in the table. @Namespace("tensorflow::ops") public static native Node LookupTableSize(@ByVal NodeBuilder.NodeOut table_handle, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node LookupTableSize(Node table_handle, @Const @ByRef GraphDefBuilder.Options opts); // A queue that produces elements in first-in first-out order. // // Variable-size shapes are allowed by setting the corresponding shape dimensions // to 0 in the shape attr. In this case DequeueMany will pad up to the maximum // size of any given element in the minibatch. See below for details. // // Arguments: // * component_types: The type of each component in a value. // * opts: // .WithAttr("shapes", gtl::ArraySlice): Defaults to []. // The shape of each component in a value. The length of this attr must // be either 0 or the same as the length of component_types. // Shapes of fixed rank but variable size are allowed by setting // any shape dimension to -1. In this case, the inputs' shape may vary along // the given dimension, and DequeueMany will pad the given dimension with // zeros up to the maximum shape of all elements in the given batch. // If the length of this attr is 0, different queue elements may have // different ranks and shapes, but only one element may be dequeued at a time. // .WithAttr("capacity", int64): Defaults to -1. // The upper bound on the number of elements in this queue. // Negative numbers mean no limit. // .WithAttr("container", StringPiece): Defaults to "". // If non-empty, this queue is placed in the given container. // Otherwise, a default container is used. // .WithAttr("shared_name", StringPiece): Defaults to "". // If non-empty, this queue will be shared under the given name // across multiple sessions. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The handle to the queue. @Namespace("tensorflow::ops") public static native Node PaddingFIFOQueue(@ByVal DataTypeVector component_types, @Const @ByRef GraphDefBuilder.Options opts); // Closes the given queue. // // This operation signals that no more elements will be enqueued in the // given queue. Subsequent Enqueue(Many) operations will fail. // Subsequent Dequeue(Many) operations will continue to succeed if // sufficient elements remain in the queue. Subsequent Dequeue(Many) // operations that would block will fail immediately. // // Arguments: // * handle: The handle to a queue. // * opts: // .WithAttr("cancel_pending_enqueues", bool): Defaults to false. // If true, all pending enqueue requests that are // blocked on the given queue will be cancelled. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node QueueClose(@ByVal NodeBuilder.NodeOut handle, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node QueueClose(Node handle, @Const @ByRef GraphDefBuilder.Options opts); // Dequeues a tuple of one or more tensors from the given queue. // // This operation has k outputs, where k is the number of components // in the tuples stored in the given queue, and output i is the ith // component of the dequeued tuple. // // N.B. If the queue is empty, this operation will block until an element // has been dequeued (or 'timeout_ms' elapses, if specified). // // Arguments: // * handle: The handle to a queue. // * component_types: The type of each component in a tuple. // * opts: // .WithAttr("timeout_ms", int64): Defaults to -1. // If the queue is empty, this operation will block for up to // timeout_ms milliseconds. // Note: This option is not supported yet. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // One or more tensors that were dequeued as a tuple. @Namespace("tensorflow::ops") public static native Node QueueDequeue(@ByVal NodeBuilder.NodeOut handle, @ByVal DataTypeVector component_types, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node QueueDequeue(Node handle, @ByVal DataTypeVector component_types, @Const @ByRef GraphDefBuilder.Options opts); // Dequeues n tuples of one or more tensors from the given queue. // // This operation concatenates queue-element component tensors along the // 0th dimension to make a single component tensor. All of the components // in the dequeued tuple will have size n in the 0th dimension. // // This operation has k outputs, where k is the number of components in // the tuples stored in the given queue, and output i is the ith // component of the dequeued tuple. // // N.B. If the queue is empty, this operation will block until n elements // have been dequeued (or 'timeout_ms' elapses, if specified). // // Arguments: // * handle: The handle to a queue. // * n: The number of tuples to dequeue. // * component_types: The type of each component in a tuple. // * opts: // .WithAttr("timeout_ms", int64): Defaults to -1. // If the queue has fewer than n elements, this operation // will block for up to timeout_ms milliseconds. // Note: This option is not supported yet. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // One or more tensors that were dequeued as a tuple. @Namespace("tensorflow::ops") public static native Node QueueDequeueMany(@ByVal NodeBuilder.NodeOut handle, @ByVal NodeBuilder.NodeOut n, @ByVal DataTypeVector component_types, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node QueueDequeueMany(Node handle, Node n, @ByVal DataTypeVector component_types, @Const @ByRef GraphDefBuilder.Options opts); // Enqueues a tuple of one or more tensors in the given queue. // // The components input has k elements, which correspond to the components of // tuples stored in the given queue. // // N.B. If the queue is full, this operation will block until the given // element has been enqueued (or 'timeout_ms' elapses, if specified). // // Arguments: // * handle: The handle to a queue. // * components: One or more tensors from which the enqueued tensors should be taken. // * opts: // .WithAttr("timeout_ms", int64): Defaults to -1. // If the queue is full, this operation will block for up to // timeout_ms milliseconds. // Note: This option is not supported yet. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node QueueEnqueue(@ByVal NodeBuilder.NodeOut handle, @ByVal NodeOutVector components, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node QueueEnqueue(Node handle, @ByVal NodeOutVector components, @Const @ByRef GraphDefBuilder.Options opts); // Enqueues zero or more tuples of one or more tensors in the given queue. // // This operation slices each component tensor along the 0th dimension to // make multiple queue elements. All of the tuple components must have the // same size in the 0th dimension. // // The components input has k elements, which correspond to the components of // tuples stored in the given queue. // // N.B. If the queue is full, this operation will block until the given // elements have been enqueued (or 'timeout_ms' elapses, if specified). // // Arguments: // * handle: The handle to a queue. // * components: One or more tensors from which the enqueued tensors should // be taken. // * opts: // .WithAttr("timeout_ms", int64): Defaults to -1. // If the queue is too full, this operation will block for up // to timeout_ms milliseconds. // Note: This option is not supported yet. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node QueueEnqueueMany(@ByVal NodeBuilder.NodeOut handle, @ByVal NodeOutVector components, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node QueueEnqueueMany(Node handle, @ByVal NodeOutVector components, @Const @ByRef GraphDefBuilder.Options opts); // Computes the number of elements in the given queue. // // Arguments: // * handle: The handle to a queue. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The number of elements in the given queue. @Namespace("tensorflow::ops") public static native Node QueueSize(@ByVal NodeBuilder.NodeOut handle, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node QueueSize(Node handle, @Const @ByRef GraphDefBuilder.Options opts); // A queue that randomizes the order of elements. // // Arguments: // * component_types: The type of each component in a value. // * opts: // .WithAttr("shapes", gtl::ArraySlice): Defaults to []. // The shape of each component in a value. The length of this attr must // be either 0 or the same as the length of component_types. If the length of // this attr is 0, the shapes of queue elements are not constrained, and // only one element may be dequeued at a time. // .WithAttr("capacity", int64): Defaults to -1. // The upper bound on the number of elements in this queue. // Negative numbers mean no limit. // .WithAttr("min_after_dequeue", int64): Defaults to 0. // Dequeue will block unless there would be this // many elements after the dequeue or the queue is closed. This // ensures a minimum level of mixing of elements. // .WithAttr("seed", int64): Defaults to 0. // If either seed or seed2 is set to be non-zero, the random number // generator is seeded by the given seed. Otherwise, a random seed is used. // .WithAttr("seed2", int64): Defaults to 0. // A second seed to avoid seed collision. // .WithAttr("container", StringPiece): Defaults to "". // If non-empty, this queue is placed in the given container. // Otherwise, a default container is used. // .WithAttr("shared_name", StringPiece): Defaults to "". // If non-empty, this queue will be shared under the given name // across multiple sessions. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The handle to the queue. @Namespace("tensorflow::ops") public static native Node RandomShuffleQueue(@ByVal DataTypeVector component_types, @Const @ByRef GraphDefBuilder.Options opts); // A stack that produces elements in first-in last-out order. // // Arguments: // * elem_type: The type of the elements on the stack. // * opts: // .WithAttr("stack_name", StringPiece): Defaults to "". // Overrides the name used for the temporary stack resource. Default // value is the name of the 'Stack' op (which is guaranteed unique). // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The handle to the stack. @Namespace("tensorflow::ops") public static native Node Stack(@Cast("tensorflow::DataType") int elem_type, @Const @ByRef GraphDefBuilder.Options opts); // Delete the stack from its resource container. // // Arguments: // * handle: The handle to a stack. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node StackClose(@ByVal NodeBuilder.NodeOut handle, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node StackClose(Node handle, @Const @ByRef GraphDefBuilder.Options opts); // Pop the element at the top of the stack. // // Arguments: // * handle: The handle to a stack. // * elem_type: The type of the elem that is popped. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The tensor that is popped from the top of the stack. @Namespace("tensorflow::ops") public static native Node StackPop(@ByVal NodeBuilder.NodeOut handle, @Cast("tensorflow::DataType") int elem_type, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node StackPop(Node handle, @Cast("tensorflow::DataType") int elem_type, @Const @ByRef GraphDefBuilder.Options opts); // Push an element onto the stack. // // Arguments: // * handle: The handle to a stack. // * elem: The tensor to be pushed onto the stack. // * opts: // .WithAttr("swap_memory", bool): Defaults to false. // Swap `elem` to CPU. Default to false. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The same tensor as the input 'elem'. @Namespace("tensorflow::ops") public static native Node StackPush(@ByVal NodeBuilder.NodeOut handle, @ByVal NodeBuilder.NodeOut elem, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node StackPush(Node handle, Node elem, @Const @ByRef GraphDefBuilder.Options opts); // An array of Tensors of given size, with data written via Write and read // // via Read or Pack. // // Arguments: // * size: The size of the array. // * dtype: The type of the elements on the tensor_array. // * opts: // .WithAttr("dynamic_size", bool): Defaults to false. // A boolean that determines whether writes to the TensorArray // are allowed to grow the size. By default, this is not allowed. // .WithAttr("clear_after_read", bool): Defaults to true. // If true (default), Tensors in the TensorArray are cleared // after being read. This disables multiple read semantics but allows early // release of memory. // .WithAttr("tensor_array_name", StringPiece): Defaults to "". // Overrides the name used for the temporary tensor_array // resource. Default value is the name of the 'TensorArray' op (which // is guaranteed unique). // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The handle to the TensorArray. @Namespace("tensorflow::ops") public static native Node TensorArray(@ByVal NodeBuilder.NodeOut size, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node TensorArray(Node size, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); // Delete the TensorArray from its resource container. This enables // // the user to close and release the resource in the middle of a step/run. // // Arguments: // * handle: The handle to a TensorArray (output of TensorArray or TensorArrayGrad). // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node TensorArrayClose(@ByVal NodeBuilder.NodeOut handle, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node TensorArrayClose(Node handle, @Const @ByRef GraphDefBuilder.Options opts); // Concat the elements from the TensorArray into value `value`. // // Takes `T` elements of shapes // // ``` // (n0 x d0 x d1 x ...), (n1 x d0 x d1 x ...), ..., (n(T-1) x d0 x d1 x ...) // ``` // // and concatenates them into a Tensor of shape: // // ```(n0 + n1 + ... + n(T-1) x d0 x d1 x ...)``` // // All elements must have the same shape (excepting the first dimension). // // Arguments: // * handle: The handle to a TensorArray. // * flow_in: A float scalar that enforces proper chaining of operations. // * dtype: The type of the elem that is returned. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * value: All of the elements in the TensorArray, concatenated along the first // axis. // * lengths: A vector of the row sizes of the original T elements in the // value output. In the example above, this would be the values: // `(n1, n2, ..., n(T-1))`. @Namespace("tensorflow::ops") public static native Node TensorArrayConcat(@ByVal NodeBuilder.NodeOut handle, @ByVal NodeBuilder.NodeOut flow_in, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node TensorArrayConcat(Node handle, Node flow_in, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); // Creates a TensorArray for storing the gradients of values in the given handle. // // If the given TensorArray gradient already exists, returns a reference to it. // // Locks the size of the original TensorArray by disabling its dynamic size flag. // // **A note about the input flow_in:** // // The handle flow_in forces the execution of the gradient lookup to occur // only after certain other operations have occurred. For example, when // the forward TensorArray is dynamically sized, writes to this TensorArray // may resize the object. The gradient TensorArray is statically sized based // on the size of the forward TensorArray when this operation executes. // Furthermore, the size of the forward TensorArray is frozen by this call. // As a result, the flow is used to ensure that the call to generate the gradient // TensorArray only happens after all writes are executed. // // In terms of e.g. python TensorArray sugar wrappers when using dynamically sized // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node TensorArrayGrad(@ByVal NodeBuilder.NodeOut handle, @ByVal NodeBuilder.NodeOut flow_in, @StringPiece BytePointer source, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node TensorArrayGrad(Node handle, Node flow_in, @StringPiece String source, @Const @ByRef GraphDefBuilder.Options opts); // Pack the elements from the TensorArray into output `value`. // // All elements must have the same shape. // // Arguments: // * handle: The handle to a TensorArray. // * flow_in: A float scalar that enforces proper chaining of operations. // * dtype: The type of the elem that is returned. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // All of the elements in the TensorArray, concatenated along a new // axis (the new dimension 0). @Namespace("tensorflow::ops") public static native Node TensorArrayPack(@ByVal NodeBuilder.NodeOut handle, @ByVal NodeBuilder.NodeOut flow_in, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node TensorArrayPack(Node handle, Node flow_in, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); // Read an element from the TensorArray into output `value`. // // Arguments: // * handle: The handle to a TensorArray. // * flow_in: A float scalar that enforces proper chaining of operations. // * dtype: The type of the elem that is returned. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The tensor that is read from the TensorArray. @Namespace("tensorflow::ops") public static native Node TensorArrayRead(@ByVal NodeBuilder.NodeOut handle, @ByVal NodeBuilder.NodeOut index, @ByVal NodeBuilder.NodeOut flow_in, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node TensorArrayRead(Node handle, Node index, Node flow_in, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); // Get the current size of the TensorArray. // // Arguments: // * handle: The handle to a TensorArray (output of TensorArray or TensorArrayGrad). // * flow_in: A float scalar that enforces proper chaining of operations. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The current size of the TensorArray. @Namespace("tensorflow::ops") public static native Node TensorArraySize(@ByVal NodeBuilder.NodeOut handle, @ByVal NodeBuilder.NodeOut flow_in, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node TensorArraySize(Node handle, Node flow_in, @Const @ByRef GraphDefBuilder.Options opts); // Split the data from the input value into TensorArray elements. // // Assuming that `lengths` takes on values // // ```(n0, n1, ..., n(T-1))``` // // and that `value` has shape // // ```(n0 + n1 + ... + n(T-1) x d0 x d1 x ...)```, // // this splits values into a TensorArray with T tensors. // // TensorArray index t will be the subtensor of values with starting position // // ```(n0 + n1 + ... + n(t-1), 0, 0, ...)``` // // and having size // // ```nt x d0 x d1 x ...``` // // Arguments: // * handle: The handle to a TensorArray. // * value: The concatenated tensor to write to the TensorArray. // * lengths: The vector of lengths, how to split the rows of value into the // TensorArray. // * flow_in: A float scalar that enforces proper chaining of operations. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A float scalar that enforces proper chaining of operations. @Namespace("tensorflow::ops") public static native Node TensorArraySplit(@ByVal NodeBuilder.NodeOut handle, @ByVal NodeBuilder.NodeOut value, @ByVal NodeBuilder.NodeOut lengths, @ByVal NodeBuilder.NodeOut flow_in, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node TensorArraySplit(Node handle, Node value, Node lengths, Node flow_in, @Const @ByRef GraphDefBuilder.Options opts); // Unpack the data from the input value into TensorArray elements. // // Arguments: // * handle: The handle to a TensorArray. // * value: The concatenated tensor to write to the TensorArray. // * flow_in: A float scalar that enforces proper chaining of operations. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A float scalar that enforces proper chaining of operations. @Namespace("tensorflow::ops") public static native Node TensorArrayUnpack(@ByVal NodeBuilder.NodeOut handle, @ByVal NodeBuilder.NodeOut value, @ByVal NodeBuilder.NodeOut flow_in, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node TensorArrayUnpack(Node handle, Node value, Node flow_in, @Const @ByRef GraphDefBuilder.Options opts); // Push an element onto the tensor_array. // // Arguments: // * handle: The handle to a TensorArray. // * index: The position to write to inside the TensorArray. // * value: The tensor to write to the TensorArray. // * flow_in: A float scalar that enforces proper chaining of operations. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A float scalar that enforces proper chaining of operations. @Namespace("tensorflow::ops") public static native Node TensorArrayWrite(@ByVal NodeBuilder.NodeOut handle, @ByVal NodeBuilder.NodeOut index, @ByVal NodeBuilder.NodeOut value, @ByVal NodeBuilder.NodeOut flow_in, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node TensorArrayWrite(Node handle, Node index, Node value, Node flow_in, @Const @ByRef GraphDefBuilder.Options opts); // namespace ops // namespace tensorflow // #endif // TENSORFLOW_CC_OPS_DATA_FLOW_OPS_H_ // Parsed from tensorflow/cc/ops/image_ops.h // This file is MACHINE GENERATED! Do not edit. // #ifndef TENSORFLOW_CC_OPS_IMAGE_OPS_H_ // #define TENSORFLOW_CC_OPS_IMAGE_OPS_H_ // #include "tensorflow/core/framework/tensor.h" // #include "tensorflow/core/framework/tensor_shape.h" // #include "tensorflow/core/framework/types.h" // #include "tensorflow/core/graph/graph_def_builder.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // These add a node to the graph from opts. // // Note for "NodeOut" inputs, you will typically either pass // * a {Node*, int index} (to pass the index-th output of that node), or // * a Node* (to pass the first output of that node). // Deprecated. Disallowed in GraphDef version >= 2. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node AdjustContrast(@ByVal NodeBuilder.NodeOut images, @ByVal NodeBuilder.NodeOut contrast_factor, @ByVal NodeBuilder.NodeOut min_value, @ByVal NodeBuilder.NodeOut max_value, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node AdjustContrast(Node images, Node contrast_factor, Node min_value, Node max_value, @Const @ByRef GraphDefBuilder.Options opts); // Adjust the contrast of one or more images. // // `images` is a tensor of at least 3 dimensions. The last 3 dimensions are // interpreted as `[height, width, channels]`. The other dimensions only // represent a collection of images, such as `[batch, height, width, channels].` // // Contrast is adjusted independently for each channel of each image. // // For each channel, the Op first computes the mean of the image pixels in the // channel and then adjusts each component of each pixel to // `(x - mean) * contrast_factor + mean`. // // Arguments: // * images: Images to adjust. At least 3-D. // * contrast_factor: A float multiplier for adjusting contrast. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The contrast-adjusted image or images. @Namespace("tensorflow::ops") public static native Node AdjustContrastv2(@ByVal NodeBuilder.NodeOut images, @ByVal NodeBuilder.NodeOut contrast_factor, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node AdjustContrastv2(Node images, Node contrast_factor, @Const @ByRef GraphDefBuilder.Options opts); // Decode a JPEG-encoded image to a uint8 tensor. // // The attr `channels` indicates the desired number of color channels for the // decoded image. // // Accepted values are: // // * 0: Use the number of channels in the JPEG-encoded image. // * 1: output a grayscale image. // * 3: output an RGB image. // // If needed, the JPEG-encoded image is transformed to match the requested number // of color channels. // // The attr `ratio` allows downscaling the image by an integer factor during // decoding. Allowed values are: 1, 2, 4, and 8. This is much faster than // downscaling the image later. // // Arguments: // * contents: 0-D. The JPEG-encoded image. // * opts: // .WithAttr("channels", int64): Defaults to 0. // Number of color channels for the decoded image. // .WithAttr("ratio", int64): Defaults to 1. // Downscaling ratio. // .WithAttr("fancy_upscaling", bool): Defaults to true. // If true use a slower but nicer upscaling of the // chroma planes (yuv420/422 only). // .WithAttr("try_recover_truncated", bool): Defaults to false. // If true try to recover an image from truncated input. // .WithAttr("acceptable_fraction", float): Defaults to 1. // The minimum required fraction of lines before a truncated // input is accepted. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 3-D with shape `[height, width, channels]`.. @Namespace("tensorflow::ops") public static native Node DecodeJpeg(@ByVal NodeBuilder.NodeOut contents, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DecodeJpeg(Node contents, @Const @ByRef GraphDefBuilder.Options opts); // Decode a PNG-encoded image to a uint8 or uint16 tensor. // // The attr `channels` indicates the desired number of color channels for the // decoded image. // // Accepted values are: // // * 0: Use the number of channels in the PNG-encoded image. // * 1: output a grayscale image. // * 3: output an RGB image. // * 4: output an RGBA image. // // If needed, the PNG-encoded image is transformed to match the requested number // of color channels. // // Arguments: // * contents: 0-D. The PNG-encoded image. // * opts: // .WithAttr("channels", int64): Defaults to 0. // Number of color channels for the decoded image. // .WithAttr("dtype", DataType): Defaults to DT_UINT8. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 3-D with shape `[height, width, channels]`. @Namespace("tensorflow::ops") public static native Node DecodePng(@ByVal NodeBuilder.NodeOut contents, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DecodePng(Node contents, @Const @ByRef GraphDefBuilder.Options opts); // Draw bounding boxes on a batch of images. // // Outputs a copy of `images` but draws on top of the pixels zero or more bounding // boxes specified by the locations in `boxes`. The coordinates of the each // bounding box in `boxes are encoded as `[y_min, x_min, y_max, x_max]`. The // bounding box coordinates are floats in `[0.0, 1.0]` relative to the width and // height of the underlying image. // // For example, if an image is 100 x 200 pixels and the bounding box is // `[0.1, 0.5, 0.2, 0.9]`, the bottom-left and upper-right coordinates of the // bounding box will be `(10, 40)` to `(50, 180)`. // // Parts of the bounding box may fall outside the image. // // Arguments: // * images: 4-D with shape `[batch, height, width, depth]`. A batch of images. // * boxes: 3-D with shape `[batch, num_bounding_boxes, 4]` containing bounding // boxes. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 4-D with the same shape as `images`. The batch of input images with // bounding boxes drawn on the images. @Namespace("tensorflow::ops") public static native Node DrawBoundingBoxes(@ByVal NodeBuilder.NodeOut images, @ByVal NodeBuilder.NodeOut boxes, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DrawBoundingBoxes(Node images, Node boxes, @Const @ByRef GraphDefBuilder.Options opts); // JPEG-encode an image. // // `image` is a 3-D uint8 Tensor of shape `[height, width, channels]`. // // The attr `format` can be used to override the color format of the encoded // output. Values can be: // // * `''`: Use a default format based on the number of channels in the image. // * `grayscale`: Output a grayscale JPEG image. The `channels` dimension // of `image` must be 1. // * `rgb`: Output an RGB JPEG image. The `channels` dimension // of `image` must be 3. // // If `format` is not specified or is the empty string, a default format is picked // in function of the number of channels in `image`: // // * 1: Output a grayscale image. // * 3: Output an RGB image. // // Arguments: // * image: 3-D with shape `[height, width, channels]`. // * opts: // .WithAttr("format", StringPiece): Defaults to "". // Per pixel image format. // .WithAttr("quality", int64): Defaults to 95. // Quality of the compression from 0 to 100 (higher is better and slower). // .WithAttr("progressive", bool): Defaults to false. // If True, create a JPEG that loads progressively (coarse to fine). // .WithAttr("optimize_size", bool): Defaults to false. // If True, spend CPU/RAM to reduce size with no quality change. // .WithAttr("chroma_downsampling", bool): Defaults to true. // See http://en.wikipedia.org/wiki/Chroma_subsampling. // .WithAttr("density_unit", StringPiece): Defaults to "in". // Unit used to specify `x_density` and `y_density`: // pixels per inch (`'in'`) or centimeter (`'cm'`). // .WithAttr("x_density", int64): Defaults to 300. // Horizontal pixels per density unit. // .WithAttr("y_density", int64): Defaults to 300. // Vertical pixels per density unit. // .WithAttr("xmp_metadata", StringPiece): Defaults to "". // If not empty, embed this XMP metadata in the image header. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 0-D. JPEG-encoded image. @Namespace("tensorflow::ops") public static native Node EncodeJpeg(@ByVal NodeBuilder.NodeOut image, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node EncodeJpeg(Node image, @Const @ByRef GraphDefBuilder.Options opts); // PNG-encode an image. // // `image` is a 3-D uint8 or uint16 Tensor of shape `[height, width, channels]` // where `channels` is: // // * 1: for grayscale. // * 2: for grayscale + alpha. // * 3: for RGB. // * 4: for RGBA. // // The ZLIB compression level, `compression`, can be -1 for the PNG-encoder // default or a value from 0 to 9. 9 is the highest compression level, generating // the smallest output, but is slower. // // Arguments: // * image: 3-D with shape `[height, width, channels]`. // * opts: // .WithAttr("compression", int64): Defaults to -1. // Compression level. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 0-D. PNG-encoded image. @Namespace("tensorflow::ops") public static native Node EncodePng(@ByVal NodeBuilder.NodeOut image, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node EncodePng(Node image, @Const @ByRef GraphDefBuilder.Options opts); // Extracts a glimpse from the input tensor. // // Returns a set of windows called glimpses extracted at location // `offsets` from the input tensor. If the windows only partially // overlaps the inputs, the non overlapping areas will be filled with // random noise. // // The result is a 4-D tensor of shape `[batch_size, glimpse_height, // glimpse_width, channels]`. The channels and batch dimensions are the // same as that of the input tensor. The height and width of the output // windows are specified in the `size` parameter. // // The argument `normalized` and `centered` controls how the windows are // // Arguments: // * opts: // .WithAttr("centered", bool): Defaults to true. // .WithAttr("normalized", bool): Defaults to true. // .WithAttr("uniform_noise", bool): Defaults to true. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node ExtractGlimpse(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut size, @ByVal NodeBuilder.NodeOut offsets, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ExtractGlimpse(Node input, Node size, Node offsets, @Const @ByRef GraphDefBuilder.Options opts); // Convert one or more images from HSV to RGB. // // Outputs a tensor of the same shape as the `images` tensor, containing the RGB // value of the pixels. The output is only well defined if the value in `images` // are in `[0,1]`. // // See `rgb_to_hsv` for a description of the HSV encoding. // // Arguments: // * images: 1-D or higher rank. HSV data to convert. Last dimension must be size 3. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // `images` converted to RGB. @Namespace("tensorflow::ops") public static native Node HSVToRGB(@ByVal NodeBuilder.NodeOut images, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node HSVToRGB(Node images, @Const @ByRef GraphDefBuilder.Options opts); // Converts one or more images from RGB to HSV. // // Outputs a tensor of the same shape as the `images` tensor, containing the HSV // value of the pixels. The output is only well defined if the value in `images` // are in `[0,1]`. // // `output[..., 0]` contains hue, `output[..., 1]` contains saturation, and // `output[..., 2]` contains value. All HSV values are in `[0,1]`. A hue of 0 // corresponds to pure red, hue 1/3 is pure green, and 2/3 is pure blue. // // Arguments: // * images: 1-D or higher rank. RGB data to convert. Last dimension must be size 3. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // `images` converted to HSV. @Namespace("tensorflow::ops") public static native Node RGBToHSV(@ByVal NodeBuilder.NodeOut images, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node RGBToHSV(Node images, @Const @ByRef GraphDefBuilder.Options opts); // Randomly crop `image`. // // `size` is a 1-D int64 tensor with 2 elements representing the crop height and // width. The values must be non negative. // // This Op picks a random location in `image` and crops a `height` by `width` // rectangle from that location. The random location is picked so the cropped // area will fit inside the original image. // // Arguments: // * image: 3-D of shape `[height, width, channels]`. // * size: 1-D of length 2 containing: `crop_height`, `crop_width`.. // * opts: // .WithAttr("seed", int64): Defaults to 0. // If either seed or seed2 are set to be non-zero, the random number // generator is seeded by the given seed. Otherwise, it is seeded by a // random seed. // .WithAttr("seed2", int64): Defaults to 0. // An second seed to avoid seed collision. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 3-D of shape `[crop_height, crop_width, channels].` @Namespace("tensorflow::ops") public static native Node RandomCrop(@ByVal NodeBuilder.NodeOut image, @ByVal NodeBuilder.NodeOut size, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node RandomCrop(Node image, Node size, @Const @ByRef GraphDefBuilder.Options opts); // Resize `images` to `size` using area interpolation. // // Input images can be of different types but output images are always float. // // Arguments: // * images: 4-D with shape `[batch, height, width, channels]`. // * size: = A 1-D int32 Tensor of 2 elements: `new_height, new_width`. The // new size for the images. // * opts: // .WithAttr("align_corners", bool): Defaults to false. // If true, rescale input by (new_height - 1) / (height - 1), which // exactly aligns the 4 corners of images and resized images. If false, rescale // by new_height / height. Treat similarly the width dimension. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 4-D with shape // `[batch, new_height, new_width, channels]`. @Namespace("tensorflow::ops") public static native Node ResizeArea(@ByVal NodeBuilder.NodeOut images, @ByVal NodeBuilder.NodeOut size, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ResizeArea(Node images, Node size, @Const @ByRef GraphDefBuilder.Options opts); // Resize `images` to `size` using bicubic interpolation. // // Input images can be of different types but output images are always float. // // Arguments: // * images: 4-D with shape `[batch, height, width, channels]`. // * size: = A 1-D int32 Tensor of 2 elements: `new_height, new_width`. The // new size for the images. // * opts: // .WithAttr("align_corners", bool): Defaults to false. // If true, rescale input by (new_height - 1) / (height - 1), which // exactly aligns the 4 corners of images and resized images. If false, rescale // by new_height / height. Treat similarly the width dimension. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 4-D with shape // `[batch, new_height, new_width, channels]`. @Namespace("tensorflow::ops") public static native Node ResizeBicubic(@ByVal NodeBuilder.NodeOut images, @ByVal NodeBuilder.NodeOut size, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ResizeBicubic(Node images, Node size, @Const @ByRef GraphDefBuilder.Options opts); // Resize `images` to `size` using bilinear interpolation. // // Input images can be of different types but output images are always float. // // Arguments: // * images: 4-D with shape `[batch, height, width, channels]`. // * size: = A 1-D int32 Tensor of 2 elements: `new_height, new_width`. The // new size for the images. // * opts: // .WithAttr("align_corners", bool): Defaults to false. // If true, rescale input by (new_height - 1) / (height - 1), which // exactly aligns the 4 corners of images and resized images. If false, rescale // by new_height / height. Treat similarly the width dimension. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 4-D with shape // `[batch, new_height, new_width, channels]`. @Namespace("tensorflow::ops") public static native Node ResizeBilinear(@ByVal NodeBuilder.NodeOut images, @ByVal NodeBuilder.NodeOut size, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ResizeBilinear(Node images, Node size, @Const @ByRef GraphDefBuilder.Options opts); // Computes the gradient of bilinear interpolation. // // Arguments: // * grads: 4-D with shape `[batch, height, width, channels]`. // * original_image: 4-D with shape `[batch, orig_height, orig_width, channels]`, // The image tensor that was resized. // * opts: // .WithAttr("align_corners", bool): Defaults to false. // If true, rescale grads by (orig_height - 1) / (height - 1), which // exactly aligns the 4 corners of grads and original_image. If false, rescale by // orig_height / height. Treat similarly the width dimension. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 4-D with shape `[batch, orig_height, orig_width, channels]`. // Gradients with respect to the input image. Input image must have been // float or double. @Namespace("tensorflow::ops") public static native Node ResizeBilinearGrad(@ByVal NodeBuilder.NodeOut grads, @ByVal NodeBuilder.NodeOut original_image, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ResizeBilinearGrad(Node grads, Node original_image, @Const @ByRef GraphDefBuilder.Options opts); // Resize `images` to `size` using nearest neighbor interpolation. // // Arguments: // * images: 4-D with shape `[batch, height, width, channels]`. // * size: = A 1-D int32 Tensor of 2 elements: `new_height, new_width`. The // new size for the images. // * opts: // .WithAttr("align_corners", bool): Defaults to false. // If true, rescale input by (new_height - 1) / (height - 1), which // exactly aligns the 4 corners of images and resized images. If false, rescale // by new_height / height. Treat similarly the width dimension. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 4-D with shape // `[batch, new_height, new_width, channels]`. @Namespace("tensorflow::ops") public static native Node ResizeNearestNeighbor(@ByVal NodeBuilder.NodeOut images, @ByVal NodeBuilder.NodeOut size, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ResizeNearestNeighbor(Node images, Node size, @Const @ByRef GraphDefBuilder.Options opts); // Computes the gradient of nearest neighbor interpolation. // // Arguments: // * grads: 4-D with shape `[batch, height, width, channels]`. // * size: = A 1-D int32 Tensor of 2 elements: `orig_height, orig_width`. The // original input size. // * opts: // .WithAttr("align_corners", bool): Defaults to false. // If true, rescale grads by (orig_height - 1) / (height - 1), which // exactly aligns the 4 corners of grads and original_image. If false, rescale by // orig_height / height. Treat similarly the width dimension. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 4-D with shape `[batch, orig_height, orig_width, channels]`. Gradients // with respect to the input image. @Namespace("tensorflow::ops") public static native Node ResizeNearestNeighborGrad(@ByVal NodeBuilder.NodeOut grads, @ByVal NodeBuilder.NodeOut size, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ResizeNearestNeighborGrad(Node grads, Node size, @Const @ByRef GraphDefBuilder.Options opts); // Generate a single randomly distorted bounding box for an image. // // Bounding box annotations are often supplied in addition to ground-truth labels // in image recognition or object localization tasks. A common technique for // training such a system is to randomly distort an image while preserving // its content, i.e. *data augmentation*. This Op outputs a randomly distorted // localization of an object, i.e. bounding box, given an `image_size`, // `bounding_boxes` and a series of constraints. // // The output of this Op is a single bounding box that may be used to crop the // original image. The output is returned as 3 tensors: `begin`, `size` and // `bboxes`. The first 2 tensors can be fed directly into `tf.slice` to crop the // image. The latter may be supplied to `tf.image.draw_bounding_box` to visualize // what the bounding box looks like. // // Bounding boxes are supplied and returned as `[y_min, x_min, y_max, x_max]`. The // bounding box coordinates are floats in `[0.0, 1.0]` relative to the width and // height of the underlying image. // // For example, // // # Generate a single distorted bounding box. // begin, size, bbox_for_draw = tf.image.sample_distorted_bounding_box( // tf.shape(image), // bounding_boxes=bounding_boxes) // // # Draw the bounding box in an image summary. // image_with_box = tf.image.draw_bounding_boxes(tf.expand_dims(image, 0), // bbox_for_draw) // tf.image_summary('images_with_box', image_with_box) // // # Employ the bounding box to distort the image. // distorted_image = tf.slice(image, begin, size) // // Note that if no bounding box information is available, setting // `use_image_if_no_bounding_boxes = true` will assume there is a single implicit // bounding box covering the whole image. If `use_image_if_no_bounding_boxes` is // false and no bounding boxes are supplied, an error is raised. // // Arguments: // * image_size: 1-D, containing `[height, width, channels]`. // * bounding_boxes: 3-D with shape `[batch, N, 4]` describing the N bounding boxes // associated with the image. // * opts: // .WithAttr("seed", int64): Defaults to 0. // If either `seed` or `seed2` are set to non-zero, the random number // generator is seeded by the given `seed`. Otherwise, it is seeded by a random // seed. // .WithAttr("seed2", int64): Defaults to 0. // A second seed to avoid seed collision. // .WithAttr("min_object_covered", float): Defaults to 0.1. // The cropped area of the image must contain at least this // fraction of any bounding box supplied. // .WithAttr("aspect_ratio_range", gtl::ArraySlice): Defaults to [0.75, 1.33]. // The cropped area of the image must have an aspect ratio = // width / height within this range. // .WithAttr("area_range", gtl::ArraySlice): Defaults to [0.05, 1]. // The cropped area of the image must contain a fraction of the // supplied image within in this range. // .WithAttr("max_attempts", int64): Defaults to 100. // Number of attempts at generating a cropped region of the image // of the specified constraints. After `max_attempts` failures, return the entire // image. // .WithAttr("use_image_if_no_bounding_boxes", bool): Defaults to false. // Controls behavior if no bounding boxes supplied. // If true, assume an implicit bounding box covering the whole input. If false, // raise an error. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * begin: 1-D, containing `[offset_height, offset_width, 0]`. Provide as input to // `tf.slice`. // * size: 1-D, containing `[target_height, target_width, -1]`. Provide as input to // `tf.slice`. // * bboxes: 3-D with shape `[1, 1, 4]` containing the distorted bounding box. // Provide as input to `tf.image.draw_bounding_boxes`. @Namespace("tensorflow::ops") public static native Node SampleDistortedBoundingBox(@ByVal NodeBuilder.NodeOut image_size, @ByVal NodeBuilder.NodeOut bounding_boxes, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SampleDistortedBoundingBox(Node image_size, Node bounding_boxes, @Const @ByRef GraphDefBuilder.Options opts); // namespace ops // namespace tensorflow // #endif // TENSORFLOW_CC_OPS_IMAGE_OPS_H_ // Parsed from tensorflow/cc/ops/io_ops.h // This file is MACHINE GENERATED! Do not edit. // #ifndef TENSORFLOW_CC_OPS_IO_OPS_H_ // #define TENSORFLOW_CC_OPS_IO_OPS_H_ // #include "tensorflow/core/framework/tensor.h" // #include "tensorflow/core/framework/tensor_shape.h" // #include "tensorflow/core/framework/types.h" // #include "tensorflow/core/graph/graph_def_builder.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // These add a node to the graph from opts. // // Note for "NodeOut" inputs, you will typically either pass // * a {Node*, int index} (to pass the index-th output of that node), or // * a Node* (to pass the first output of that node). // A Reader that outputs fixed-length records from a file. // // Arguments: // * opts: // .WithAttr("header_bytes", int64): Defaults to 0. // .WithAttr("footer_bytes", int64): Defaults to 0. // .WithAttr("container", StringPiece): Defaults to "". // If non-empty, this reader is placed in the given container. // Otherwise, a default container is used. // .WithAttr("shared_name", StringPiece): Defaults to "". // If non-empty, this reader is named in the given bucket // with this shared_name. Otherwise, the node name is used instead. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The handle to reference the Reader. @Namespace("tensorflow::ops") public static native Node FixedLengthRecordReader(@Cast("tensorflow::int64") long record_bytes, @Const @ByRef GraphDefBuilder.Options opts); // A Reader that outputs the queued work as both the key and value. // // To use, enqueue strings in a Queue. ReaderRead will take the front // work string and output (work, work). // // Arguments: // * opts: // .WithAttr("container", StringPiece): Defaults to "". // If non-empty, this reader is placed in the given container. // Otherwise, a default container is used. // .WithAttr("shared_name", StringPiece): Defaults to "". // If non-empty, this reader is named in the given bucket // with this shared_name. Otherwise, the node name is used instead. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The handle to reference the Reader. @Namespace("tensorflow::ops") public static native Node IdentityReader(@Const @ByRef GraphDefBuilder.Options opts); // Returns the set of files matching a pattern. // // Note that this routine only supports wildcard characters in the // basename portion of the pattern, not in the directory portion. // // Arguments: // * pattern: A (scalar) shell wildcard pattern. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A vector of matching filenames. @Namespace("tensorflow::ops") public static native Node MatchingFiles(@ByVal NodeBuilder.NodeOut pattern, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MatchingFiles(Node pattern, @Const @ByRef GraphDefBuilder.Options opts); // Reads and outputs the entire contents of the input filename. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node ReadFile(@ByVal NodeBuilder.NodeOut filename, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ReadFile(Node filename, @Const @ByRef GraphDefBuilder.Options opts); // Returns the number of records this Reader has produced. // // This is the same as the number of ReaderRead executions that have // succeeded. // // Arguments: // * reader_handle: Handle to a Reader. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node ReaderNumRecordsProduced(@ByVal NodeBuilder.NodeOut reader_handle, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ReaderNumRecordsProduced(Node reader_handle, @Const @ByRef GraphDefBuilder.Options opts); // Returns the number of work units this Reader has finished processing. // // Arguments: // * reader_handle: Handle to a Reader. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node ReaderNumWorkUnitsCompleted(@ByVal NodeBuilder.NodeOut reader_handle, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ReaderNumWorkUnitsCompleted(Node reader_handle, @Const @ByRef GraphDefBuilder.Options opts); // Returns the next record (key, value pair) produced by a Reader. // // Will dequeue from the input queue if necessary (e.g. when the // Reader needs to start reading from a new file since it has finished // with the previous file). // // Arguments: // * reader_handle: Handle to a Reader. // * queue_handle: Handle to a Queue, with string work items. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * key: A scalar. // * value: A scalar. @Namespace("tensorflow::ops") public static native Node ReaderRead(@ByVal NodeBuilder.NodeOut reader_handle, @ByVal NodeBuilder.NodeOut queue_handle, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ReaderRead(Node reader_handle, Node queue_handle, @Const @ByRef GraphDefBuilder.Options opts); // Restore a Reader to its initial clean state. // // Arguments: // * reader_handle: Handle to a Reader. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node ReaderReset(@ByVal NodeBuilder.NodeOut reader_handle, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ReaderReset(Node reader_handle, @Const @ByRef GraphDefBuilder.Options opts); // Restore a reader to a previously saved state. // // Not all Readers support being restored, so this can produce an // Unimplemented error. // // Arguments: // * reader_handle: Handle to a Reader. // * state: Result of a ReaderSerializeState of a Reader with type // matching reader_handle. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node ReaderRestoreState(@ByVal NodeBuilder.NodeOut reader_handle, @ByVal NodeBuilder.NodeOut state, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ReaderRestoreState(Node reader_handle, Node state, @Const @ByRef GraphDefBuilder.Options opts); // Produce a string tensor that encodes the state of a Reader. // // Not all Readers support being serialized, so this can produce an // Unimplemented error. // // Arguments: // * reader_handle: Handle to a Reader. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node ReaderSerializeState(@ByVal NodeBuilder.NodeOut reader_handle, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ReaderSerializeState(Node reader_handle, @Const @ByRef GraphDefBuilder.Options opts); // Restores a tensor from checkpoint files. // // Reads a tensor stored in one or several files. If there are several files (for // instance because a tensor was saved as slices), `file_pattern` may contain // wildcard symbols (`*` and `?`) in the filename portion only, not in the // directory portion. // // If a `file_pattern` matches several files, `preferred_shard` can be used to hint // in which file the requested tensor is likely to be found. This op will first // open the file at index `preferred_shard` in the list of matching files and try // to restore tensors from that file. Only if some tensors or tensor slices are // not found in that first file, then the Op opens all the files. Setting // `preferred_shard` to match the value passed as the `shard` input // of a matching `Save` Op may speed up Restore. This attribute only affects // performance, not correctness. The default value -1 means files are processed in // order. // // See also `RestoreSlice`. // // Arguments: // * file_pattern: Must have a single element. The pattern of the files from // which we read the tensor. // * tensor_name: Must have a single element. The name of the tensor to be // restored. // * dt: The type of the tensor to be restored. // * opts: // .WithAttr("preferred_shard", int64): Defaults to -1. // Index of file to open first if multiple files match // `file_pattern`. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The restored tensor. @Namespace("tensorflow::ops") public static native Node Restore(@ByVal NodeBuilder.NodeOut file_pattern, @ByVal NodeBuilder.NodeOut tensor_name, @Cast("tensorflow::DataType") int dt, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Restore(Node file_pattern, Node tensor_name, @Cast("tensorflow::DataType") int dt, @Const @ByRef GraphDefBuilder.Options opts); // Restores a tensor from checkpoint files. // // This is like `Restore` except that restored tensor can be listed as filling // only a slice of a larger tensor. `shape_and_slice` specifies the shape of the // larger tensor and the slice that the restored tensor covers. // // The `shape_and_slice` input has the same format as the // elements of the `shapes_and_slices` input of the `SaveSlices` op. // // Arguments: // * file_pattern: Must have a single element. The pattern of the files from // which we read the tensor. // * tensor_name: Must have a single element. The name of the tensor to be // restored. // * shape_and_slice: Scalar. The shapes and slice specifications to use when // restoring a tensors. // * dt: The type of the tensor to be restored. // * opts: // .WithAttr("preferred_shard", int64): Defaults to -1. // Index of file to open first if multiple files match // `file_pattern`. See the documentation for `Restore`. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The restored tensor. @Namespace("tensorflow::ops") public static native Node RestoreSlice(@ByVal NodeBuilder.NodeOut file_pattern, @ByVal NodeBuilder.NodeOut tensor_name, @ByVal NodeBuilder.NodeOut shape_and_slice, @Cast("tensorflow::DataType") int dt, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node RestoreSlice(Node file_pattern, Node tensor_name, Node shape_and_slice, @Cast("tensorflow::DataType") int dt, @Const @ByRef GraphDefBuilder.Options opts); // Saves the input tensors to disk. // // The size of `tensor_names` must match the number of tensors in `data`. `data[i]` // is written to `filename` with name `tensor_names[i]`. // // See also `SaveSlices`. // // Arguments: // * filename: Must have a single element. The name of the file to which we write // the tensor. // * tensor_names: Shape `[N]`. The names of the tensors to be saved. // * data: `N` tensors to save. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Save(@ByVal NodeBuilder.NodeOut filename, @ByVal NodeBuilder.NodeOut tensor_names, @ByVal NodeOutVector data, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Save(Node filename, Node tensor_names, @ByVal NodeOutVector data, @Const @ByRef GraphDefBuilder.Options opts); // Saves input tensors slices to disk. // // This is like `Save` except that tensors can be listed in the saved file as being // a slice of a larger tensor. `shapes_and_slices` specifies the shape of the // larger tensor and the slice that this tensor covers. `shapes_and_slices` must // have as many elements as `tensor_names`. // // Elements of the `shapes_and_slices` input must either be: // // * The empty string, in which case the corresponding tensor is // saved normally. // * A string of the form `dim0 dim1 ... dimN-1 slice-spec` where the // `dimI` are the dimensions of the larger tensor and `slice-spec` // specifies what part is covered by the tensor to save. // // `slice-spec` itself is a `:`-separated list: `slice0:slice1:...:sliceN-1` // where each `sliceI` is either: // // * The string `-` meaning that the slice covers all indices of this dimension // * `start,length` where `start` and `length` are integers. In that // case the slice covers `length` indices starting at `start`. // // See also `Save`. // // Arguments: // * filename: Must have a single element. The name of the file to which we write the // tensor. // * tensor_names: Shape `[N]`. The names of the tensors to be saved. // * shapes_and_slices: Shape `[N]`. The shapes and slice specifications to use when // saving the tensors. // * data: `N` tensors to save. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node SaveSlices(@ByVal NodeBuilder.NodeOut filename, @ByVal NodeBuilder.NodeOut tensor_names, @ByVal NodeBuilder.NodeOut shapes_and_slices, @ByVal NodeOutVector data, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SaveSlices(Node filename, Node tensor_names, Node shapes_and_slices, @ByVal NodeOutVector data, @Const @ByRef GraphDefBuilder.Options opts); // Generate a sharded filename. The filename is printf formatted as // // %s-%05d-of-%05d, basename, shard, num_shards. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node ShardedFilename(@ByVal NodeBuilder.NodeOut basename, @ByVal NodeBuilder.NodeOut shard, @ByVal NodeBuilder.NodeOut num_shards, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ShardedFilename(Node basename, Node shard, Node num_shards, @Const @ByRef GraphDefBuilder.Options opts); // Generate a glob pattern matching all sharded file names. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node ShardedFilespec(@ByVal NodeBuilder.NodeOut basename, @ByVal NodeBuilder.NodeOut num_shards, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ShardedFilespec(Node basename, Node num_shards, @Const @ByRef GraphDefBuilder.Options opts); // A Reader that outputs the records from a TensorFlow Records file. // // Arguments: // * opts: // .WithAttr("container", StringPiece): Defaults to "". // If non-empty, this reader is placed in the given container. // Otherwise, a default container is used. // .WithAttr("shared_name", StringPiece): Defaults to "". // If non-empty, this reader is named in the given bucket // with this shared_name. Otherwise, the node name is used instead. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The handle to reference the Reader. @Namespace("tensorflow::ops") public static native Node TFRecordReader(@Const @ByRef GraphDefBuilder.Options opts); // A Reader that outputs the lines of a file delimited by '\n'. // // Arguments: // * opts: // .WithAttr("skip_header_lines", int64): Defaults to 0. // Number of lines to skip from the beginning of every file. // .WithAttr("container", StringPiece): Defaults to "". // If non-empty, this reader is placed in the given container. // Otherwise, a default container is used. // .WithAttr("shared_name", StringPiece): Defaults to "". // If non-empty, this reader is named in the given bucket // with this shared_name. Otherwise, the node name is used instead. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The handle to reference the Reader. @Namespace("tensorflow::ops") public static native Node TextLineReader(@Const @ByRef GraphDefBuilder.Options opts); // A Reader that outputs the entire contents of a file as a value. // // To use, enqueue filenames in a Queue. The output of ReaderRead will // be a filename (key) and the contents of that file (value). // // Arguments: // * opts: // .WithAttr("container", StringPiece): Defaults to "". // If non-empty, this reader is placed in the given container. // Otherwise, a default container is used. // .WithAttr("shared_name", StringPiece): Defaults to "". // If non-empty, this reader is named in the given bucket // with this shared_name. Otherwise, the node name is used instead. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The handle to reference the Reader. @Namespace("tensorflow::ops") public static native Node WholeFileReader(@Const @ByRef GraphDefBuilder.Options opts); // namespace ops // namespace tensorflow // #endif // TENSORFLOW_CC_OPS_IO_OPS_H_ // Parsed from tensorflow/cc/ops/linalg_ops.h // This file is MACHINE GENERATED! Do not edit. // #ifndef TENSORFLOW_CC_OPS_LINALG_OPS_H_ // #define TENSORFLOW_CC_OPS_LINALG_OPS_H_ // #include "tensorflow/core/framework/tensor.h" // #include "tensorflow/core/framework/tensor_shape.h" // #include "tensorflow/core/framework/types.h" // #include "tensorflow/core/graph/graph_def_builder.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // These add a node to the graph from opts. // // Note for "NodeOut" inputs, you will typically either pass // * a {Node*, int index} (to pass the index-th output of that node), or // * a Node* (to pass the first output of that node). // Calculates the Cholesky decomposition of a batch of square matrices. // // The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions // form square matrices, with the same constraints as the single matrix Cholesky // decomposition above. The output is a tensor of the same shape as the input // containing the Cholesky decompositions for all input submatrices `[..., :, :]`. // // Arguments: // * input: Shape is `[..., M, M]`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Shape is `[..., M, M]`. @Namespace("tensorflow::ops") public static native Node BatchCholesky(@ByVal NodeBuilder.NodeOut input, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BatchCholesky(Node input, @Const @ByRef GraphDefBuilder.Options opts); // Calculates the determinants for a batch of square matrices. // // The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions // form square matrices. The output is a 1-D tensor containing the determinants // for all input submatrices `[..., :, :]`. // // Arguments: // * input: Shape is `[..., M, M]`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Shape is `[...]`. @Namespace("tensorflow::ops") public static native Node BatchMatrixDeterminant(@ByVal NodeBuilder.NodeOut input, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BatchMatrixDeterminant(Node input, @Const @ByRef GraphDefBuilder.Options opts); // Calculates the inverse of square invertible matrices. // // The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions // form square matrices. The output is a tensor of the same shape as the input // containing the inverse for all input submatrices `[..., :, :]`. // // The op uses the Cholesky decomposition if the matrices are symmetric positive // definite and LU decomposition with partial pivoting otherwise. // // If a matrix is not invertible there is no guarantee what the op does. It // may detect the condition and raise an exception or it may simply return a // garbage result. // // Arguments: // * input: Shape is `[..., M, M]`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Shape is `[..., M, M]`. @Namespace("tensorflow::ops") public static native Node BatchMatrixInverse(@ByVal NodeBuilder.NodeOut input, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BatchMatrixInverse(Node input, @Const @ByRef GraphDefBuilder.Options opts); // Solves systems of linear equations. Checks for invertibility. // // Matrix is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions // form square matrices. Rhs is a tensor of shape // `[..., M, K]`. The output is a tensor shape `[..., M, K]`. If `adjoint` is `False` then each output // matrix satisfies `matrix[..., :, :] * output[..., :, :] = rhs[..., :, :]`. // If `adjoint` is `True` then each output // matrix satisfies `adjoint(matrix[..., :, :]) * output[..., :, :] = rhs[..., :, :]`. // // Arguments: // * matrix: Shape is `[..., M, M]`. // * rhs: Shape is `[..., M, K]`. // * opts: // .WithAttr("adjoint", bool): Defaults to false. // Boolean indicating whether to solve with `matrix` or its (block-wise) // adjoint. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Shape is `[..., M, K]`. @Namespace("tensorflow::ops") public static native Node BatchMatrixSolve(@ByVal NodeBuilder.NodeOut matrix, @ByVal NodeBuilder.NodeOut rhs, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BatchMatrixSolve(Node matrix, Node rhs, @Const @ByRef GraphDefBuilder.Options opts); // Solves multiple linear least-squares problems. // // `matrix` is a tensor of shape `[..., M, N]` whose inner-most 2 dimensions // form square matrices. Rhs is a tensor of shape `[..., M, K]`. The output // is a tensor shape `[..., N, K]` where each output matrix solves each of // the equations matrix[..., :, :] * output[..., :, :] = rhs[..., :, :] in the // least squares sense. // // Below we will use the following notation for each pair of // matrix and right-hand sides in the batch: // // `matrix`=\\(A \in \Re^{m \times n}\\), // `rhs`=\\(B \in \Re^{m \times k}\\), // `output`=\\(X \in \Re^{n \times k}\\), // `l2_regularizer`=\\(\lambda\\). // // If `fast` is `True`, then the solution is computed by solving the normal // equations using Cholesky decomposition. Specifically, if \\(m \ge n\\) then // \\(X = (A^T A + \lambda I)^{-1} A^T B\\), which solves the least-squares // problem \\(X = \mathrm{argmin}_{Z \in \Re^{n \times k}} ||A Z - B||_F^2 + // \lambda ||Z||_F^2\\). If \\(m \lt n\\) then `output` is computed as // \\(X = A^T (A A^T + \lambda I)^{-1} B\\), which (for \\(\lambda = 0\\)) is the // minimum-norm solution to the under-determined linear system, i.e. // \\(X = \mathrm{argmin}_{Z \in \Re^{n \times k}} ||Z||_F^2 \\), subject to // \\(A Z = B\\). Notice that the fast path is only numerically stable when // \\(A\\) is numerically full rank and has a condition number // \\(\mathrm{cond}(A) \lt \frac{1}{\sqrt{\epsilon_{mach}}}\\) or\\(\lambda\\) is // sufficiently large. // // If `fast` is `False` an algorithm based on the numerically robust complete // orthogonal decomposition is used. This computes the minimum-norm // least-squares solution, even when \\(A\\) is rank deficient. This path is // typically 6-7 times slower than the fast path. If `fast` is `False` then // `l2_regularizer` is ignored. // // Arguments: // * matrix: Shape is `[..., M, N]`. // * rhs: Shape is `[..., M, K]`. // * opts: // .WithAttr("fast", bool): Defaults to true. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Shape is `[..., N, K]`. @Namespace("tensorflow::ops") public static native Node BatchMatrixSolveLs(@ByVal NodeBuilder.NodeOut matrix, @ByVal NodeBuilder.NodeOut rhs, @ByVal NodeBuilder.NodeOut l2_regularizer, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BatchMatrixSolveLs(Node matrix, Node rhs, Node l2_regularizer, @Const @ByRef GraphDefBuilder.Options opts); // Solves systems of linear equations with upper or lower triangular matrices by // // backsubstitution. // // `matrix` is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions form // square matrices. If `lower` is `True` then the strictly upper triangular part // of each inner-most matrix is assumed to be zero and not accessed. // If `lower` is False then the strictly lower triangular part of each inner-most // matrix is assumed to be zero and not accessed. // `rhs` is a tensor of shape [..., M, K]`. // // The output is a tensor of shape `[..., M, K]`. If `adjoint` is `True` then the // innermost matrices in output` satisfy matrix equations // `matrix[..., :, :] * output[..., :, :] = rhs[..., :, :]`. // If `adjoint` is `False` then the strictly then the innermost matrices in // `output` satisfy matrix equations // `adjoint(matrix[..., i, k]) * output[..., k, j] = rhs[..., i, j]`. // // Arguments: // * matrix: Shape is `[..., M, M]`. // * rhs: Shape is `[..., M, K]`. // * opts: // .WithAttr("lower", bool): Defaults to true. // Boolean indicating whether the innermost matrices in `matrix` are // lower or upper triangular. // .WithAttr("adjoint", bool): Defaults to false. // Boolean indicating whether to solve with `matrix` or its (block-wise) // adjoint. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Shape is `[..., M, K]`. @Namespace("tensorflow::ops") public static native Node BatchMatrixTriangularSolve(@ByVal NodeBuilder.NodeOut matrix, @ByVal NodeBuilder.NodeOut rhs, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BatchMatrixTriangularSolve(Node matrix, Node rhs, @Const @ByRef GraphDefBuilder.Options opts); // Calculates the Eigen Decomposition of a batch of square self-adjoint matrices. // // The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions // form square matrices, with the same constraints as the single matrix // SelfAdjointEig. // // The result is a '[..., M+1, M] matrix with [..., 0,:] containing the // eigenvalues, and subsequent [...,1:, :] containing the eigenvectors. // // Arguments: // * input: Shape is `[..., M, M]`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Shape is `[..., M+1, M]`. @Namespace("tensorflow::ops") public static native Node BatchSelfAdjointEig(@ByVal NodeBuilder.NodeOut input, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BatchSelfAdjointEig(Node input, @Const @ByRef GraphDefBuilder.Options opts); // Calculates the Cholesky decomposition of a square matrix. // // The input has to be symmetric and positive definite. Only the lower-triangular // part of the input will be used for this operation. The upper-triangular part // will not be read. // // The result is the lower-triangular matrix of the Cholesky decomposition of the // input. // // Arguments: // * input: Shape is `[M, M]`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Shape is `[M, M]`. @Namespace("tensorflow::ops") public static native Node Cholesky(@ByVal NodeBuilder.NodeOut input, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Cholesky(Node input, @Const @ByRef GraphDefBuilder.Options opts); // Calculates the reverse mode backpropagated gradient of the Cholesky algorithm. // // For an explanation see "Differentiation of the Cholesky algorithm" by Iain Murray http://arxiv.org/abs/1602.07527. // // Arguments: // * l: Output of Cholesky algorithm l = chol(A). Shape is `[M, M]`. Algorithm depends only on lower triangular part of this matrix. // * grad: df/dl where f is some scalar function. Shape is `[M, M]'. Algorithm depends only on lower triangular part of this matrix. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Symmetrized version of df/dA . Shape is `[M, M]' @Namespace("tensorflow::ops") public static native Node CholeskyGrad(@ByVal NodeBuilder.NodeOut l, @ByVal NodeBuilder.NodeOut grad, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node CholeskyGrad(Node l, Node grad, @Const @ByRef GraphDefBuilder.Options opts); // Calculates the determinant of a square matrix. // // Arguments: // * input: A tensor of shape `[M, M]`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A scalar, equal to the determinant of the input. @Namespace("tensorflow::ops") public static native Node MatrixDeterminant(@ByVal NodeBuilder.NodeOut input, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MatrixDeterminant(Node input, @Const @ByRef GraphDefBuilder.Options opts); // Calculates the inverse of a square invertible matrix. // // The op uses the Cholesky decomposition if the matrix is symmetric positive // definite and LU decomposition with partial pivoting otherwise. // // If the matrix is not invertible there is no guarantee what the op does. It // may detect the condition and raise an exception or it may simply return a // garbage result. // // Arguments: // * input: Shape is `[M, M]`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Shape is `[M, M]` containing the matrix inverse of the input. @Namespace("tensorflow::ops") public static native Node MatrixInverse(@ByVal NodeBuilder.NodeOut input, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MatrixInverse(Node input, @Const @ByRef GraphDefBuilder.Options opts); // Solves a system of linear equations. Checks for invertibility. // // Arguments: // * matrix: Shape is `[M, M]`. // * rhs: Shape is `[M, K]`. // * opts: // .WithAttr("adjoint", bool): Defaults to false. // Boolean indicating whether to solve with `matrix` or its adjoint. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Shape is `[M, K]`. If `adjoint` is `False` then `output` that solves // `matrix` * `output` = `rhs`. If `adjoint` is `True` then `output` that solves // `adjoint(matrix)` * `output` = `rhs`. @Namespace("tensorflow::ops") public static native Node MatrixSolve(@ByVal NodeBuilder.NodeOut matrix, @ByVal NodeBuilder.NodeOut rhs, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MatrixSolve(Node matrix, Node rhs, @Const @ByRef GraphDefBuilder.Options opts); // Solves a linear least-squares problem. // // Below we will use the following notation // `matrix`=\\(A \in \Re^{m \times n}\\), // `rhs`=\\(B \in \Re^{m \times k}\\), // `output`=\\(X \in \Re^{n \times k}\\), // `l2_regularizer`=\\(\lambda\\). // // If `fast` is `True`, then the solution is computed by solving the normal // equations using Cholesky decomposition. Specifically, if \\(m \ge n\\) then // \\(X = (A^T A + \lambda I)^{-1} A^T B\\), which solves the least-squares // problem \\(X = \mathrm{argmin}_{Z \in \Re^{n \times k}} ||A Z - B||_F^2 + // \lambda ||Z||_F^2\\). If \\(m \lt n\\) then `output` is computed as // \\(X = A^T (A A^T + \lambda I)^{-1} B\\), // which (for \\(\lambda = 0\\)) is the minimum-norm solution to the // under-determined linear system, i.e. // \\(X = \mathrm{argmin}_{Z \in \Re^{n \times k}} ||Z||_F^2 \\), // subject to \\(A Z = B\\). // Notice that the fast path is only numerically stable when \\(A\\) is // numerically full rank and has a condition number // \\(\mathrm{cond}(A) \lt \frac{1}{\sqrt{\epsilon_{mach}}}\\) // or \\(\lambda\\) is sufficiently large. // // If `fast` is `False` an algorithm based on the numerically robust complete // orthogonal decomposition is used. This computes the minimum-norm // least-squares solution, even when \\(A\\) is rank deficient. This path is // typically 6-7 times slower than the fast path. If `fast` is `False` then // `l2_regularizer` is ignored. // // Arguments: // * matrix: Shape is `[M, N]`. // * rhs: Shape is `[M, K]`. // * opts: // .WithAttr("fast", bool): Defaults to true. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Shape is `[N, K]` containing the tensor that solves // `matrix * output = rhs` in the least-squares sense. @Namespace("tensorflow::ops") public static native Node MatrixSolveLs(@ByVal NodeBuilder.NodeOut matrix, @ByVal NodeBuilder.NodeOut rhs, @ByVal NodeBuilder.NodeOut l2_regularizer, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MatrixSolveLs(Node matrix, Node rhs, Node l2_regularizer, @Const @ByRef GraphDefBuilder.Options opts); // Solves a system of linear equations with an upper or lower triangular matrix by // // backsubstitution. // // `matrix` is a matrix of shape `[M, M]`. If `lower` is `True` then the strictly // upper triangular part of `matrix` is assumed to be zero and not accessed. // If `lower` is False then the strictly lower triangular part of `matrix` is // assumed to be zero and not accessed. // `rhs` is a matrix of shape [M, K]`. // // The output is a matrix of shape `[M, K]`. If `adjoint` is `False` the output // satisfies the matrix equation `matrix` * `output` = `rhs`. // If `adjoint` is `False` then `output` satisfies the matrix equation // `matrix` * `output` = `rhs`. // If `adjoint` is `True` then `output` satisfies the matrix equation // `adjoint(matrix)` * `output` = `rhs`. // // Arguments: // * matrix: Shape is `[M, M]`. // * rhs: Shape is `[M, K]`. // * opts: // .WithAttr("lower", bool): Defaults to true. // Boolean indicating whether `matrix` is lower or upper triangular // .WithAttr("adjoint", bool): Defaults to false. // Boolean indicating whether to solve with `matrix` or its adjoint. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Shape is `[M, K]`. @Namespace("tensorflow::ops") public static native Node MatrixTriangularSolve(@ByVal NodeBuilder.NodeOut matrix, @ByVal NodeBuilder.NodeOut rhs, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MatrixTriangularSolve(Node matrix, Node rhs, @Const @ByRef GraphDefBuilder.Options opts); // Calculates the Eigen Decomposition of a square Self-Adjoint matrix. // // Only the lower-triangular part of the input will be used in this case. The // upper-triangular part will not be read. // // The result is a M+1 x M matrix whose first row is the eigenvalues, and // subsequent rows are eigenvectors. // // Arguments: // * input: Shape is `[M, M]`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Shape is `[M+1, M]`. @Namespace("tensorflow::ops") public static native Node SelfAdjointEig(@ByVal NodeBuilder.NodeOut input, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SelfAdjointEig(Node input, @Const @ByRef GraphDefBuilder.Options opts); // namespace ops // namespace tensorflow // #endif // TENSORFLOW_CC_OPS_LINALG_OPS_H_ // Parsed from tensorflow/cc/ops/logging_ops.h // This file is MACHINE GENERATED! Do not edit. // #ifndef TENSORFLOW_CC_OPS_LOGGING_OPS_H_ // #define TENSORFLOW_CC_OPS_LOGGING_OPS_H_ // #include "tensorflow/core/framework/tensor.h" // #include "tensorflow/core/framework/tensor_shape.h" // #include "tensorflow/core/framework/types.h" // #include "tensorflow/core/graph/graph_def_builder.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // These add a node to the graph from opts. // // Note for "NodeOut" inputs, you will typically either pass // * a {Node*, int index} (to pass the index-th output of that node), or // * a Node* (to pass the first output of that node). // Asserts that the given condition is true. // // If `condition` evaluates to false, print the list of tensors in `data`. // `summarize` determines how many entries of the tensors to print. // // Arguments: // * condition: The condition to evaluate. // * data: The tensors to print out when condition is false. // * opts: // .WithAttr("summarize", int64): Defaults to 3. // Print this many entries of each tensor. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Assert(@ByVal NodeBuilder.NodeOut condition, @ByVal NodeOutVector data, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Assert(Node condition, @ByVal NodeOutVector data, @Const @ByRef GraphDefBuilder.Options opts); // Outputs a `Summary` protocol buffer with a histogram. // // The generated // [`Summary`](https://www.tensorflow.org/code/tensorflow/core/framework/summary.proto) // has one summary value containing a histogram for `values`. // // This op reports an `InvalidArgument` error if any value is not finite. // // Arguments: // * tag: Scalar. Tag to use for the `Summary.Value`. // * values: Any shape. Values to use to build the histogram. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Scalar. Serialized `Summary` protocol buffer. @Namespace("tensorflow::ops") public static native Node HistogramSummary(@ByVal NodeBuilder.NodeOut tag, @ByVal NodeBuilder.NodeOut values, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node HistogramSummary(Node tag, Node values, @Const @ByRef GraphDefBuilder.Options opts); // Outputs a `Summary` protocol buffer with images. // // The summary has up to `max_images` summary values containing images. The // images are built from `tensor` which must be 4-D with shape `[batch_size, // height, width, channels]` and where `channels` can be: // // * 1: `tensor` is interpreted as Grayscale. // * 3: `tensor` is interpreted as RGB. // * 4: `tensor` is interpreted as RGBA. // // The images have the same number of channels as the input tensor. For float // input, the values are normalized one image at a time to fit in the range // `[0, 255]`. `uint8` values are unchanged. The op uses two different // normalization algorithms: // // * If the input values are all positive, they are rescaled so the largest one // is 255. // // * If any input value is negative, the values are shifted so input value 0.0 // is at 127. They are then rescaled so that either the smallest value is 0, // or the largest one is 255. // // The `tag` argument is a scalar `Tensor` of type `string`. It is used to // build the `tag` of the summary values: // // * If `max_images` is 1, the summary value tag is '*tag*/image'. // * If `max_images` is greater than 1, the summary value tags are // generated sequentially as '*tag*/image/0', '*tag*/image/1', etc. // // The `bad_color` argument is the color to use in the generated images for // non-finite input values. It is a `unit8` 1-D tensor of length `channels`. // Each element must be in the range `[0, 255]` (It represents the value of a // pixel in the output image). Non-finite values in the input tensor are // replaced by this tensor in the output image. The default value is the color // red. // // Arguments: // * tag: Scalar. Used to build the `tag` attribute of the summary values. // * tensor: 4-D of shape `[batch_size, height, width, channels]` where // `channels` is 1, 3, or 4. // * opts: // .WithAttr("max_images", int64): Defaults to 3. // Max number of batch elements to generate images for. // .WithAttr("bad_color", const Tensor&): Defaults to Tensor. // Color to use for pixels with non-finite values. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Scalar. Serialized `Summary` protocol buffer. @Namespace("tensorflow::ops") public static native Node ImageSummary(@ByVal NodeBuilder.NodeOut tag, @ByVal NodeBuilder.NodeOut tensor, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ImageSummary(Node tag, Node tensor, @Const @ByRef GraphDefBuilder.Options opts); // Merges summaries. // // This op creates a // [`Summary`](https://www.tensorflow.org/code/tensorflow/core/framework/summary.proto) // protocol buffer that contains the union of all the values in the input // summaries. // // When the Op is run, it reports an `InvalidArgument` error if multiple values // in the summaries to merge use the same tag. // // Arguments: // * inputs: Can be of any shape. Each must contain serialized `Summary` protocol // buffers. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Scalar. Serialized `Summary` protocol buffer. @Namespace("tensorflow::ops") public static native Node MergeSummary(@ByVal NodeOutVector inputs, @Const @ByRef GraphDefBuilder.Options opts); // Prints a list of tensors. // // Passes `input` through to `output` and prints `data` when evaluating. // // Arguments: // * input: The tensor passed to `output` // * data: A list of tensors to print out when op is evaluated. // * opts: // .WithAttr("message", StringPiece): Defaults to "". // A string, prefix of the error message. // .WithAttr("first_n", int64): Defaults to -1. // Only log `first_n` number of times. -1 disables logging. // .WithAttr("summarize", int64): Defaults to 3. // Only print this many entries of each tensor. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The unmodified `input` tensor @Namespace("tensorflow::ops") public static native Node Print(@ByVal NodeBuilder.NodeOut input, @ByVal NodeOutVector data, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Print(Node input, @ByVal NodeOutVector data, @Const @ByRef GraphDefBuilder.Options opts); // Outputs a `Summary` protocol buffer with scalar values. // // The input `tags` and `values` must have the same shape. The generated summary // has a summary value for each tag-value pair in `tags` and `values`. // // Arguments: // * tags: Tags for the summary. // * values: Same shape as `tags. Values for the summary. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Scalar. Serialized `Summary` protocol buffer. @Namespace("tensorflow::ops") public static native Node ScalarSummary(@ByVal NodeBuilder.NodeOut tags, @ByVal NodeBuilder.NodeOut values, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ScalarSummary(Node tags, Node values, @Const @ByRef GraphDefBuilder.Options opts); // namespace ops // namespace tensorflow // #endif // TENSORFLOW_CC_OPS_LOGGING_OPS_H_ // Parsed from tensorflow/cc/ops/math_ops.h // This file is MACHINE GENERATED! Do not edit. // #ifndef TENSORFLOW_CC_OPS_MATH_OPS_H_ // #define TENSORFLOW_CC_OPS_MATH_OPS_H_ // #include "tensorflow/core/framework/tensor.h" // #include "tensorflow/core/framework/tensor_shape.h" // #include "tensorflow/core/framework/types.h" // #include "tensorflow/core/graph/graph_def_builder.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // These add a node to the graph from opts. // // Note for "NodeOut" inputs, you will typically either pass // * a {Node*, int index} (to pass the index-th output of that node), or // * a Node* (to pass the first output of that node). // Computes the absolute value of a tensor. // // Given a tensor `x`, this operation returns a tensor containing the absolute // value of each element in `x`. For example, if x is an input element and y is // an output element, this operation computes \\(y = |x|\\). // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Abs(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Abs(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Returns x + y element-wise. // // *NOTE*: Add supports broadcasting. AddN does not. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Add(@ByVal NodeBuilder.NodeOut x, @ByVal NodeBuilder.NodeOut y, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Add(Node x, Node y, @Const @ByRef GraphDefBuilder.Options opts); // Add all input tensors element wise. // // Arguments: // * inputs: Must all be the same size and shape. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node AddN(@ByVal NodeOutVector inputs, @Const @ByRef GraphDefBuilder.Options opts); // Computes the "logical and" of elements across dimensions of a tensor. // // Reduces `input` along the dimensions given in `reduction_indices`. Unless // `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in // `reduction_indices`. If `keep_dims` is true, the reduced dimensions are // retained with length 1. // // Arguments: // * input: The tensor to reduce. // * reduction_indices: The dimensions to reduce. // * opts: // .WithAttr("keep_dims", bool): Defaults to false. // If true, retain reduced dimensions with length 1. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The reduced tensor. @Namespace("tensorflow::ops") public static native Node All(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut reduction_indices, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node All(Node input, Node reduction_indices, @Const @ByRef GraphDefBuilder.Options opts); // Computes the "logical or" of elements across dimensions of a tensor. // // Reduces `input` along the dimensions given in `reduction_indices`. Unless // `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in // `reduction_indices`. If `keep_dims` is true, the reduced dimensions are // retained with length 1. // // Arguments: // * input: The tensor to reduce. // * reduction_indices: The dimensions to reduce. // * opts: // .WithAttr("keep_dims", bool): Defaults to false. // If true, retain reduced dimensions with length 1. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The reduced tensor. @Namespace("tensorflow::ops") public static native Node Any(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut reduction_indices, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Any(Node input, Node reduction_indices, @Const @ByRef GraphDefBuilder.Options opts); // Returns the index with the largest value across dimensions of a tensor. // // Arguments: // * dimension: int32, 0 <= dimension < rank(input). Describes which dimension // of the input Tensor to reduce across. For vectors, use dimension = 0. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node ArgMax(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut dimension, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ArgMax(Node input, Node dimension, @Const @ByRef GraphDefBuilder.Options opts); // Returns the index with the smallest value across dimensions of a tensor. // // Arguments: // * dimension: int32, 0 <= dimension < rank(input). Describes which dimension // of the input Tensor to reduce across. For vectors, use dimension = 0. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node ArgMin(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut dimension, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ArgMin(Node input, Node dimension, @Const @ByRef GraphDefBuilder.Options opts); // Compute the 1-dimensional discrete Fourier Transform over the inner-most // // dimension of `in`. // // Arguments: // * in: A complex64 tensor. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A complex64 tensor of the same shape as `in`. The inner-most dimension of // `in` is replaced with its 1D Fourier Transform. @Namespace("tensorflow::ops") public static native Node BatchFFT(@ByVal NodeBuilder.NodeOut in, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BatchFFT(Node in, @Const @ByRef GraphDefBuilder.Options opts); // Compute the 2-dimensional discrete Fourier Transform over the inner-most // // 2 dimensions of `in`. // // Arguments: // * in: A complex64 tensor. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A complex64 tensor of the same shape as `in`. The inner-most 2 dimensions // of `in` are replaced with their 2D Fourier Transform. @Namespace("tensorflow::ops") public static native Node BatchFFT2D(@ByVal NodeBuilder.NodeOut in, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BatchFFT2D(Node in, @Const @ByRef GraphDefBuilder.Options opts); // Compute the 3-dimensional discrete Fourier Transform over the inner-most 3 // // dimensions of `in`. // // Arguments: // * in: A complex64 tensor. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A complex64 tensor of the same shape as `in`. The inner-most 3 dimensions // of `in` are replaced with their 3D Fourier Transform. @Namespace("tensorflow::ops") public static native Node BatchFFT3D(@ByVal NodeBuilder.NodeOut in, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BatchFFT3D(Node in, @Const @ByRef GraphDefBuilder.Options opts); // Compute the inverse 1-dimensional discrete Fourier Transform over the inner-most // // dimension of `in`. // // Arguments: // * in: A complex64 tensor. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A complex64 tensor of the same shape as `in`. The inner-most dimension of // `in` is replaced with its inverse 1D Fourier Transform. @Namespace("tensorflow::ops") public static native Node BatchIFFT(@ByVal NodeBuilder.NodeOut in, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BatchIFFT(Node in, @Const @ByRef GraphDefBuilder.Options opts); // Compute the inverse 2-dimensional discrete Fourier Transform over the inner-most // // 2 dimensions of `in`. // // Arguments: // * in: A complex64 tensor. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A complex64 tensor of the same shape as `in`. The inner-most 2 dimensions // of `in` are replaced with their inverse 2D Fourier Transform. @Namespace("tensorflow::ops") public static native Node BatchIFFT2D(@ByVal NodeBuilder.NodeOut in, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BatchIFFT2D(Node in, @Const @ByRef GraphDefBuilder.Options opts); // Compute the inverse 3-dimensional discrete Fourier Transform over the inner-most // // 3 dimensions of `in`. // // Arguments: // * in: A complex64 tensor. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A complex64 tensor of the same shape as `in`. The inner-most 3 dimensions // of `in` are replaced with their inverse 3D Fourier Transform. @Namespace("tensorflow::ops") public static native Node BatchIFFT3D(@ByVal NodeBuilder.NodeOut in, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BatchIFFT3D(Node in, @Const @ByRef GraphDefBuilder.Options opts); // Multiplies slices of two tensors in batches. // // Multiplies all slices of `Tensor` `x` and `y` (each slice can be // viewed as an element of a batch), and arranges the individual results // in a single output tensor of the same batch size. Each of the // individual slices can optionally be adjointed (to adjoint a matrix // means to transpose and conjugate it) before multiplication by setting // the `adj_x` or `adj_y` flag to `True`, which are by default `False`. // // The input tensors `x` and `y` are 3-D or higher with shape `[..., r_x, c_x]` // and `[..., r_y, c_y]`. // // The output tensor is 3-D or higher with shape `[..., r_o, c_o]`, where: // // r_o = c_x if adj_x else r_x // c_o = r_y if adj_y else c_y // // It is computed as: // // out[..., :, :] = matrix(x[..., :, :]) * matrix(y[..., :, :]) // // Arguments: // * x: 3-D or higher with shape `[..., r_x, c_x]`. // * y: 3-D or higher with shape `[..., r_y, c_y]`. // * opts: // .WithAttr("adj_x", bool): Defaults to false. // If `True`, adjoint the slices of `x`. Defaults to `False`. // .WithAttr("adj_y", bool): Defaults to false. // If `True`, adjoint the slices of `y`. Defaults to `False`. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 3-D or higher with shape `[..., r_o, c_o]` @Namespace("tensorflow::ops") public static native Node BatchMatMul(@ByVal NodeBuilder.NodeOut x, @ByVal NodeBuilder.NodeOut y, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BatchMatMul(Node x, Node y, @Const @ByRef GraphDefBuilder.Options opts); // Cast x of type SrcT to y of DstT. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Cast(@ByVal NodeBuilder.NodeOut x, @Cast("tensorflow::DataType") int DstT, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Cast(Node x, @Cast("tensorflow::DataType") int DstT, @Const @ByRef GraphDefBuilder.Options opts); // Returns element-wise smallest integer in not less than x. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Ceil(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Ceil(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Converts two real numbers to a complex number. // // Given a tensor `real` representing the real part of a complex number, and a // tensor `imag` representing the imaginary part of a complex number, this // operation returns complex numbers elementwise of the form \\(a + bj\\), where // *a* represents the `real` part and *b* represents the `imag` part. // // The input tensors `real` and `imag` must have the same shape. // // For example: // // ``` // # tensor 'real' is [2.25, 3.25] // # tensor `imag` is [4.75, 5.75] // tf.complex(real, imag) ==> [[2.25 + 4.75j], [3.25 + 5.75j]] // ``` // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Complex(@ByVal NodeBuilder.NodeOut real, @ByVal NodeBuilder.NodeOut imag, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Complex(Node real, Node imag, @Const @ByRef GraphDefBuilder.Options opts); // Computes the complex absolute value of a tensor. // // Given a tensor `x` of complex numbers, this operation returns a tensor of type // `float` that is the absolute value of each element in `x`. All elements in `x` // must be complex numbers of the form \\(a + bj\\). The absolute value is // computed as \\( \sqrt{a^2 + b^2}\\). // // For example: // // ``` // # tensor 'x' is [[-2.25 + 4.75j], [-3.25 + 5.75j]] // tf.complex_abs(x) ==> [5.25594902, 6.60492229] // ``` // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node ComplexAbs(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ComplexAbs(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Returns the complex conjugate of a complex number. // // Given a tensor `in` of complex numbers, this operation returns a tensor of // complex numbers that are the complex conjugate of each element in `in`. The // complex numbers in `in` must be of the form \\(a + bj\\), where *a* is the real // part and *b* is the imaginary part. // // The complex conjugate returned by this operation is of the form \\(a - bj\\). // // For example: // // ``` // # tensor 'in' is [-2.25 + 4.75j, 3.25 + 5.75j] // tf.conj(in) ==> [-2.25 - 4.75j, 3.25 - 5.75j] // ``` // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Conj(@ByVal NodeBuilder.NodeOut in, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Conj(Node in, @Const @ByRef GraphDefBuilder.Options opts); // Computes cos of x element-wise. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Cos(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Cos(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Compute the pairwise cross product. // // `a` and `b` must be the same shape; they can either be simple 3-element vectors, // or any shape where the innermost dimension is 3. In the latter case, each pair // of corresponding 3-element vectors is cross-multiplied independently. // // Arguments: // * a: A tensor containing 3-element vectors. // * b: Another tensor, of same type and shape as `a`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Pairwise cross product of the vectors in `a` and `b`. @Namespace("tensorflow::ops") public static native Node Cross(@ByVal NodeBuilder.NodeOut a, @ByVal NodeBuilder.NodeOut b, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Cross(Node a, Node b, @Const @ByRef GraphDefBuilder.Options opts); // Computes Psi, the derivative of Lgamma (the log of the absolute value of // // `Gamma(x)`), element-wise. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Digamma(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Digamma(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Returns x / y element-wise. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Div(@ByVal NodeBuilder.NodeOut x, @ByVal NodeBuilder.NodeOut y, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Div(Node x, Node y, @Const @ByRef GraphDefBuilder.Options opts); // Returns the truth value of (x == y) element-wise. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Equal(@ByVal NodeBuilder.NodeOut x, @ByVal NodeBuilder.NodeOut y, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Equal(Node x, Node y, @Const @ByRef GraphDefBuilder.Options opts); // Computes the Gauss error function of `x` element-wise. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Erf(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Erf(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Computes the complementary error function of `x` element-wise. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Erfc(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Erfc(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Computes exponential of x element-wise. \\(y = e^x\\). // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Exp(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Exp(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Compute the 1-dimensional discrete Fourier Transform. // // Arguments: // * in: A complex64 vector. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The 1D Fourier Transform of `in`. @Namespace("tensorflow::ops") public static native Node FFT(@ByVal NodeBuilder.NodeOut in, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node FFT(Node in, @Const @ByRef GraphDefBuilder.Options opts); // Compute the 2-dimensional discrete Fourier Transform. // // Arguments: // * in: A complex64 matrix. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The 2D Fourier Transform of `in`. @Namespace("tensorflow::ops") public static native Node FFT2D(@ByVal NodeBuilder.NodeOut in, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node FFT2D(Node in, @Const @ByRef GraphDefBuilder.Options opts); // Compute the 3-dimensional discrete Fourier Transform. // // Arguments: // * in: A complex64 3-D tensor. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The 3D Fourier Transform of `in`. @Namespace("tensorflow::ops") public static native Node FFT3D(@ByVal NodeBuilder.NodeOut in, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node FFT3D(Node in, @Const @ByRef GraphDefBuilder.Options opts); // Returns element-wise largest integer not greater than x. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Floor(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Floor(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Returns the truth value of (x > y) element-wise. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Greater(@ByVal NodeBuilder.NodeOut x, @ByVal NodeBuilder.NodeOut y, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Greater(Node x, Node y, @Const @ByRef GraphDefBuilder.Options opts); // Returns the truth value of (x >= y) element-wise. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node GreaterEqual(@ByVal NodeBuilder.NodeOut x, @ByVal NodeBuilder.NodeOut y, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node GreaterEqual(Node x, Node y, @Const @ByRef GraphDefBuilder.Options opts); // Compute the inverse 1-dimensional discrete Fourier Transform. // // Arguments: // * in: A complex64 vector. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The inverse 1D Fourier Transform of `in`. @Namespace("tensorflow::ops") public static native Node IFFT(@ByVal NodeBuilder.NodeOut in, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node IFFT(Node in, @Const @ByRef GraphDefBuilder.Options opts); // Compute the inverse 2-dimensional discrete Fourier Transform. // // Arguments: // * in: A complex64 matrix. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The inverse 2D Fourier Transform of `in`. @Namespace("tensorflow::ops") public static native Node IFFT2D(@ByVal NodeBuilder.NodeOut in, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node IFFT2D(Node in, @Const @ByRef GraphDefBuilder.Options opts); // Compute the inverse 3-dimensional discrete Fourier Transform. // // Arguments: // * in: A complex64 3-D tensor. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The inverse 3D Fourier Transform of `in`. @Namespace("tensorflow::ops") public static native Node IFFT3D(@ByVal NodeBuilder.NodeOut in, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node IFFT3D(Node in, @Const @ByRef GraphDefBuilder.Options opts); // Compute the lower regularized incomplete Gamma function `Q(a, x)`. // // The lower regularized incomplete Gamma function is defined as: // // ``` // P(a, x) = gamma(a, x) / Gamma(x) = 1 - Q(a, x) // ``` // where // ``` // gamma(a, x) = int_{0}^{x} t^{a-1} exp(-t) dt // ``` // is the lower incomplete Gamma function. // // Note, above `Q(a, x)` (`Igammac`) is the upper regularized complete // Gamma function. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Igamma(@ByVal NodeBuilder.NodeOut a, @ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Igamma(Node a, Node x, @Const @ByRef GraphDefBuilder.Options opts); // Compute the upper regularized incomplete Gamma function `Q(a, x)`. // // The upper regularized incomplete Gamma function is defined as: // // ``` // Q(a, x) = Gamma(a, x) / Gamma(x) = 1 - P(a, x) // ``` // where // ``` // Gamma(a, x) = int_{x}^{\infty} t^{a-1} exp(-t) dt // ``` // is the upper incomplete Gama function. // // Note, above `P(a, x)` (`Igamma`) is the lower regularized complete // Gamma function. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Igammac(@ByVal NodeBuilder.NodeOut a, @ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Igammac(Node a, Node x, @Const @ByRef GraphDefBuilder.Options opts); // Returns the imaginary part of a complex number. // // Given a tensor `in` of complex numbers, this operation returns a tensor of type // `float` that is the imaginary part of each element in `in`. All elements in `in` // must be complex numbers of the form \\(a + bj\\), where *a* is the real part // and *b* is the imaginary part returned by this operation. // // For example: // // ``` // # tensor 'in' is [-2.25 + 4.75j, 3.25 + 5.75j] // tf.imag(in) ==> [4.75, 5.75] // ``` // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Imag(@ByVal NodeBuilder.NodeOut in, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Imag(Node in, @Const @ByRef GraphDefBuilder.Options opts); // Computes the reciprocal of x element-wise. // // I.e., \\(y = 1 / x\\). // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Inv(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Inv(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Returns which elements of x are finite. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node IsFinite(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node IsFinite(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Returns which elements of x are Inf. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node IsInf(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node IsInf(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Returns which elements of x are NaN. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node IsNan(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node IsNan(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Returns the truth value of (x < y) element-wise. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Less(@ByVal NodeBuilder.NodeOut x, @ByVal NodeBuilder.NodeOut y, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Less(Node x, Node y, @Const @ByRef GraphDefBuilder.Options opts); // Returns the truth value of (x <= y) element-wise. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node LessEqual(@ByVal NodeBuilder.NodeOut x, @ByVal NodeBuilder.NodeOut y, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node LessEqual(Node x, Node y, @Const @ByRef GraphDefBuilder.Options opts); // Computes the log of the absolute value of `Gamma(x)` element-wise. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Lgamma(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Lgamma(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Generates values in an interval. // // A sequence of `num` evenly-spaced values are generated beginning at `start`. // If `num > 1`, the values in the sequence increase by `stop - start / num - 1`, // so that the last one is exactly `stop`. // // For example: // // ``` // tf.linspace(10.0, 12.0, 3, name="linspace") => [ 10.0 11.0 12.0] // ``` // // Arguments: // * start: First entry in the range. // * stop: Last entry in the range. // * num: Number of values to generate. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 1-D. The generated values. @Namespace("tensorflow::ops") public static native Node LinSpace(@ByVal NodeBuilder.NodeOut start, @ByVal NodeBuilder.NodeOut stop, @ByVal NodeBuilder.NodeOut num, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node LinSpace(Node start, Node stop, Node num, @Const @ByRef GraphDefBuilder.Options opts); // Computes natural logarithm of x element-wise. // // I.e., \\(y = \log_e x\\). // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Log(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Log(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Returns the truth value of x AND y element-wise. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node LogicalAnd(@ByVal NodeBuilder.NodeOut x, @ByVal NodeBuilder.NodeOut y, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node LogicalAnd(Node x, Node y, @Const @ByRef GraphDefBuilder.Options opts); // Returns the truth value of NOT x element-wise. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node LogicalNot(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node LogicalNot(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Returns the truth value of x OR y element-wise. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node LogicalOr(@ByVal NodeBuilder.NodeOut x, @ByVal NodeBuilder.NodeOut y, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node LogicalOr(Node x, Node y, @Const @ByRef GraphDefBuilder.Options opts); // Multiply the matrix "a" by the matrix "b". // // The inputs must be two-dimensional matrices and the inner dimension of // "a" (after being transposed if transpose_a is true) must match the // outer dimension of "b" (after being transposed if transposed_b is // true). // // *Note*: The default kernel implementation for MatMul on GPUs uses // cublas. // // Arguments: // * opts: // .WithAttr("transpose_a", bool): Defaults to false. // If true, "a" is transposed before multiplication. // .WithAttr("transpose_b", bool): Defaults to false. // If true, "b" is transposed before multiplication. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node MatMul(@ByVal NodeBuilder.NodeOut a, @ByVal NodeBuilder.NodeOut b, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MatMul(Node a, Node b, @Const @ByRef GraphDefBuilder.Options opts); // Computes the maximum of elements across dimensions of a tensor. // // Reduces `input` along the dimensions given in `reduction_indices`. Unless // `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in // `reduction_indices`. If `keep_dims` is true, the reduced dimensions are // retained with length 1. // // Arguments: // * input: The tensor to reduce. // * reduction_indices: The dimensions to reduce. // * opts: // .WithAttr("keep_dims", bool): Defaults to false. // If true, retain reduced dimensions with length 1. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The reduced tensor. @Namespace("tensorflow::ops") public static native Node Max(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut reduction_indices, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Max(Node input, Node reduction_indices, @Const @ByRef GraphDefBuilder.Options opts); // Returns the max of x and y (i.e. x > y ? x : y) element-wise, broadcasts. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Maximum(@ByVal NodeBuilder.NodeOut x, @ByVal NodeBuilder.NodeOut y, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Maximum(Node x, Node y, @Const @ByRef GraphDefBuilder.Options opts); // Computes the mean of elements across dimensions of a tensor. // // Reduces `input` along the dimensions given in `reduction_indices`. Unless // `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in // `reduction_indices`. If `keep_dims` is true, the reduced dimensions are // retained with length 1. // // Arguments: // * input: The tensor to reduce. // * reduction_indices: The dimensions to reduce. // * opts: // .WithAttr("keep_dims", bool): Defaults to false. // If true, retain reduced dimensions with length 1. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The reduced tensor. @Namespace("tensorflow::ops") public static native Node Mean(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut reduction_indices, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Mean(Node input, Node reduction_indices, @Const @ByRef GraphDefBuilder.Options opts); // Computes the minimum of elements across dimensions of a tensor. // // Reduces `input` along the dimensions given in `reduction_indices`. Unless // `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in // `reduction_indices`. If `keep_dims` is true, the reduced dimensions are // retained with length 1. // // Arguments: // * input: The tensor to reduce. // * reduction_indices: The dimensions to reduce. // * opts: // .WithAttr("keep_dims", bool): Defaults to false. // If true, retain reduced dimensions with length 1. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The reduced tensor. @Namespace("tensorflow::ops") public static native Node Min(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut reduction_indices, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Min(Node input, Node reduction_indices, @Const @ByRef GraphDefBuilder.Options opts); // Returns the min of x and y (i.e. x < y ? x : y) element-wise, broadcasts. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Minimum(@ByVal NodeBuilder.NodeOut x, @ByVal NodeBuilder.NodeOut y, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Minimum(Node x, Node y, @Const @ByRef GraphDefBuilder.Options opts); // Returns element-wise remainder of division. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Mod(@ByVal NodeBuilder.NodeOut x, @ByVal NodeBuilder.NodeOut y, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Mod(Node x, Node y, @Const @ByRef GraphDefBuilder.Options opts); // Returns x * y element-wise. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Mul(@ByVal NodeBuilder.NodeOut x, @ByVal NodeBuilder.NodeOut y, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Mul(Node x, Node y, @Const @ByRef GraphDefBuilder.Options opts); // Computes numerical negative value element-wise. // // I.e., \\(y = -x\\). // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Neg(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Neg(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Returns the truth value of (x != y) element-wise. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node NotEqual(@ByVal NodeBuilder.NodeOut x, @ByVal NodeBuilder.NodeOut y, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node NotEqual(Node x, Node y, @Const @ByRef GraphDefBuilder.Options opts); // Computes the power of one value to another. // // Given a tensor `x` and a tensor `y`, this operation computes \\(x^y\\) for // corresponding elements in `x` and `y`. For example: // // ``` // # tensor 'x' is [[2, 2]], [3, 3]] // # tensor 'y' is [[8, 16], [2, 3]] // tf.pow(x, y) ==> [[256, 65536], [9, 27]] // ``` // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Pow(@ByVal NodeBuilder.NodeOut x, @ByVal NodeBuilder.NodeOut y, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Pow(Node x, Node y, @Const @ByRef GraphDefBuilder.Options opts); // Computes the product of elements across dimensions of a tensor. // // Reduces `input` along the dimensions given in `reduction_indices`. Unless // `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in // `reduction_indices`. If `keep_dims` is true, the reduced dimensions are // retained with length 1. // // Arguments: // * input: The tensor to reduce. // * reduction_indices: The dimensions to reduce. // * opts: // .WithAttr("keep_dims", bool): Defaults to false. // If true, retain reduced dimensions with length 1. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The reduced tensor. @Namespace("tensorflow::ops") public static native Node Prod(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut reduction_indices, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Prod(Node input, Node reduction_indices, @Const @ByRef GraphDefBuilder.Options opts); // Creates a sequence of integers. // // This operation creates a sequence of integers that begins at `start` and // extends by increments of `delta` up to but not including `limit`. // // For example: // // ``` // # 'start' is 3 // # 'limit' is 18 // # 'delta' is 3 // tf.range(start, limit, delta) ==> [3, 6, 9, 12, 15] // ``` // // Arguments: // * start: 0-D (scalar). First entry in the sequence. // * limit: 0-D (scalar). Upper limit of sequence, exclusive. // * delta: 0-D (scalar). Optional. Default is 1. Number that increments `start`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 1-D. @Namespace("tensorflow::ops") public static native Node Range(@ByVal NodeBuilder.NodeOut start, @ByVal NodeBuilder.NodeOut limit, @ByVal NodeBuilder.NodeOut delta, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Range(Node start, Node limit, Node delta, @Const @ByRef GraphDefBuilder.Options opts); // Returns the real part of a complex number. // // Given a tensor `in` of complex numbers, this operation returns a tensor of type // `float` that is the real part of each element in `in`. All elements in `in` // must be complex numbers of the form \\(a + bj\\), where *a* is the real part // returned by this operation and *b* is the imaginary part. // // For example: // // ``` // # tensor 'in' is [-2.25 + 4.75j, 3.25 + 5.75j] // tf.real(in) ==> [-2.25, 3.25] // ``` // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Real(@ByVal NodeBuilder.NodeOut in, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Real(Node in, @Const @ByRef GraphDefBuilder.Options opts); // Computes reciprocal of square root of x element-wise. // // I.e., \\(y = 1 / \sqrt{x}\\). // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Rsqrt(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Rsqrt(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Computes the maximum along segments of a tensor. // // Read [the section on Segmentation](../../api_docs/python/math_ops.md#segmentation) // for an explanation of segments. // // Computes a tensor such that // \\(output_i = \max_j(data_j)\\) where `max` is over `j` such // that `segment_ids[j] == i`. // //
// //
// // Arguments: // * segment_ids: A 1-D tensor whose rank is equal to the rank of `data`'s // first dimension. Values should be sorted and can be repeated. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Has same shape as data, except for dimension 0 which // has size `k`, the number of segments. @Namespace("tensorflow::ops") public static native Node SegmentMax(@ByVal NodeBuilder.NodeOut data, @ByVal NodeBuilder.NodeOut segment_ids, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SegmentMax(Node data, Node segment_ids, @Const @ByRef GraphDefBuilder.Options opts); // Computes the mean along segments of a tensor. // // Read [the section on // Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation // of segments. // // Computes a tensor such that // \\(output_i = \frac{\sum_j data_j}{N}\\) where `mean` is // over `j` such that `segment_ids[j] == i` and `N` is the total number of // values summed. // //
// //
// // Arguments: // * segment_ids: A 1-D tensor whose rank is equal to the rank of `data`'s // first dimension. Values should be sorted and can be repeated. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Has same shape as data, except for dimension 0 which // has size `k`, the number of segments. @Namespace("tensorflow::ops") public static native Node SegmentMean(@ByVal NodeBuilder.NodeOut data, @ByVal NodeBuilder.NodeOut segment_ids, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SegmentMean(Node data, Node segment_ids, @Const @ByRef GraphDefBuilder.Options opts); // Computes the minimum along segments of a tensor. // // Read [the section on // Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation // of segments. // // Computes a tensor such that // \\(output_i = \min_j(data_j)\\) where `min` is over `j` such // that `segment_ids[j] == i`. // //
// //
// // Arguments: // * segment_ids: A 1-D tensor whose rank is equal to the rank of `data`'s // first dimension. Values should be sorted and can be repeated. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Has same shape as data, except for dimension 0 which // has size `k`, the number of segments. @Namespace("tensorflow::ops") public static native Node SegmentMin(@ByVal NodeBuilder.NodeOut data, @ByVal NodeBuilder.NodeOut segment_ids, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SegmentMin(Node data, Node segment_ids, @Const @ByRef GraphDefBuilder.Options opts); // Computes the product along segments of a tensor. // // Read [the section on // Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation // of segments. // // Computes a tensor such that // \\(output_i = \prod_j data_j\\) where the product is over `j` such // that `segment_ids[j] == i`. // //
// //
// // Arguments: // * segment_ids: A 1-D tensor whose rank is equal to the rank of `data`'s // first dimension. Values should be sorted and can be repeated. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Has same shape as data, except for dimension 0 which // has size `k`, the number of segments. @Namespace("tensorflow::ops") public static native Node SegmentProd(@ByVal NodeBuilder.NodeOut data, @ByVal NodeBuilder.NodeOut segment_ids, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SegmentProd(Node data, Node segment_ids, @Const @ByRef GraphDefBuilder.Options opts); // Computes the sum along segments of a tensor. // // Read [the section on Segmentation](../../api_docs/python/math_ops.md#segmentation) // for an explanation of segments. // // Computes a tensor such that // \\(output_i = \sum_j data_j\\) where sum is over `j` such // that `segment_ids[j] == i`. // //
// //
// // Arguments: // * segment_ids: A 1-D tensor whose rank is equal to the rank of `data`'s // first dimension. Values should be sorted and can be repeated. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Has same shape as data, except for dimension 0 which // has size `k`, the number of segments. @Namespace("tensorflow::ops") public static native Node SegmentSum(@ByVal NodeBuilder.NodeOut data, @ByVal NodeBuilder.NodeOut segment_ids, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SegmentSum(Node data, Node segment_ids, @Const @ByRef GraphDefBuilder.Options opts); // Selects elements from `t` or `e`, depending on `condition`. // // The `t`, and `e` tensors must all have the same shape, // and the output will also have that shape. The `condition` tensor // must be a scalar if `t` and `e` are scalars. If `t` and `e` are vectors // or higher rank, then `condition` must be either a vector with size // matching the first dimension of `t`, or must have the same shape as `t`. // // The `condition` tensor acts as a mask that chooses, based on the value at each // element, whether the corresponding element / row in the output should be // taken from `t` (if true) or `e` (if false). // // If `condition` is a vector and `t` and `e` are higher rank matrices, then // it chooses which row (outer dimension) to copy from `t` and `e`. // If `condition` has the same shape as `t` and `e`, then it chooses which // element to copy from `t` and `e`. // // For example: // // ```prettyprint // # 'condition' tensor is [[True, False] // # [False, True]] // # 't' is [[1, 2], // # [3, 4]] // # 'e' is [[5, 6], // # [7, 8]] // select(condition, t, e) ==> [[1, 6], // [7, 4]] // // // # 'condition' tensor is [True, False] // # 't' is [[1, 2], // # [3, 4]] // # 'e' is [[5, 6], // # [7, 8]] // select(condition, t, e) ==> [[1, 2], // [7, 8]] // // ``` // // Arguments: // * t: = A `Tensor` which may have the same shape as `condition`. // If `condition` is rank 1, `t` may have higher rank, // but its first dimension must match the size of `condition`. // * e: = A `Tensor` with the same type and shape as `t`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A `Tensor` with the same type and shape as `t` and `e`. @Namespace("tensorflow::ops") public static native Node Select(@ByVal NodeBuilder.NodeOut condition, @ByVal NodeBuilder.NodeOut t, @ByVal NodeBuilder.NodeOut e, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Select(Node condition, Node t, Node e, @Const @ByRef GraphDefBuilder.Options opts); // Computes sigmoid of `x` element-wise. // // Specifically, `y = 1 / (1 + exp(-x))`. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Sigmoid(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Sigmoid(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Returns an element-wise indication of the sign of a number. // // `y = sign(x) = -1` if `x < 0`; 0 if `x == 0`; 1 if `x > 0`. // // For complex numbers, `y = sign(x) = x / |x|` if `x != 0`, otherwise `y = 0`. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Sign(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Sign(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Computes sin of x element-wise. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Sin(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Sin(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Multiply matrix "a" by matrix "b". // // The inputs must be two-dimensional matrices and the inner dimension of "a" must // match the outer dimension of "b". This op is optimized for the case where at // least one of "a" or "b" is sparse. The breakeven for using this versus a dense // matrix multiply on one platform was 30% zero values in the sparse matrix. // // Arguments: // * opts: // .WithAttr("transpose_a", bool): Defaults to false. // .WithAttr("transpose_b", bool): Defaults to false. // .WithAttr("a_is_sparse", bool): Defaults to false. // .WithAttr("b_is_sparse", bool): Defaults to false. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node SparseMatMul(@ByVal NodeBuilder.NodeOut a, @ByVal NodeBuilder.NodeOut b, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SparseMatMul(Node a, Node b, @Const @ByRef GraphDefBuilder.Options opts); // Computes the mean along sparse segments of a tensor. // // Read [the section on // Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation // of segments. // // Like `SegmentMean`, but `segment_ids` can have rank less than `data`'s first // dimension, selecting a subset of dimension 0, specified by `indices`. // // Arguments: // * indices: A 1-D tensor. Has same rank as `segment_ids`. // * segment_ids: A 1-D tensor. Values should be sorted and can be repeated. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Has same shape as data, except for dimension 0 which // has size `k`, the number of segments. @Namespace("tensorflow::ops") public static native Node SparseSegmentMean(@ByVal NodeBuilder.NodeOut data, @ByVal NodeBuilder.NodeOut indices, @ByVal NodeBuilder.NodeOut segment_ids, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SparseSegmentMean(Node data, Node indices, Node segment_ids, @Const @ByRef GraphDefBuilder.Options opts); // Computes gradients for SparseSegmentMean. // // Returns tensor "output" with same shape as grad, except for dimension 0 whose // value is output_dim0. // // Arguments: // * grad: gradient propagated to the SparseSegmentMean op. // * indices: indices passed to the corresponding SparseSegmentMean op. // * segment_ids: segment_ids passed to the corresponding SparseSegmentMean op. // * output_dim0: dimension 0 of "data" passed to SparseSegmentMean op. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node SparseSegmentMeanGrad(@ByVal NodeBuilder.NodeOut grad, @ByVal NodeBuilder.NodeOut indices, @ByVal NodeBuilder.NodeOut segment_ids, @ByVal NodeBuilder.NodeOut output_dim0, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SparseSegmentMeanGrad(Node grad, Node indices, Node segment_ids, Node output_dim0, @Const @ByRef GraphDefBuilder.Options opts); // Computes the sum along sparse segments of a tensor divided by the sqrt of N. // // N is the size of the segment being reduced. // // Read [the section on // Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation // of segments. // // Arguments: // * indices: A 1-D tensor. Has same rank as `segment_ids`. // * segment_ids: A 1-D tensor. Values should be sorted and can be repeated. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Has same shape as data, except for dimension 0 which // has size `k`, the number of segments. @Namespace("tensorflow::ops") public static native Node SparseSegmentSqrtN(@ByVal NodeBuilder.NodeOut data, @ByVal NodeBuilder.NodeOut indices, @ByVal NodeBuilder.NodeOut segment_ids, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SparseSegmentSqrtN(Node data, Node indices, Node segment_ids, @Const @ByRef GraphDefBuilder.Options opts); // Computes gradients for SparseSegmentSqrtN. // // Returns tensor "output" with same shape as grad, except for dimension 0 whose // value is output_dim0. // // Arguments: // * grad: gradient propagated to the SparseSegmentSqrtN op. // * indices: indices passed to the corresponding SparseSegmentSqrtN op. // * segment_ids: segment_ids passed to the corresponding SparseSegmentSqrtN op. // * output_dim0: dimension 0 of "data" passed to SparseSegmentSqrtN op. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node SparseSegmentSqrtNGrad(@ByVal NodeBuilder.NodeOut grad, @ByVal NodeBuilder.NodeOut indices, @ByVal NodeBuilder.NodeOut segment_ids, @ByVal NodeBuilder.NodeOut output_dim0, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SparseSegmentSqrtNGrad(Node grad, Node indices, Node segment_ids, Node output_dim0, @Const @ByRef GraphDefBuilder.Options opts); // Computes the sum along sparse segments of a tensor. // // Read [the section on // Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation // of segments. // // Like `SegmentSum`, but `segment_ids` can have rank less than `data`'s first // dimension, selecting a subset of dimension 0, specified by `indices`. // // For example: // // ```prettyprint // c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]]) // // # Select two rows, one segment. // tf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 0])) // ==> [[0 0 0 0]] // // # Select two rows, two segment. // tf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 1])) // ==> [[ 1 2 3 4] // [-1 -2 -3 -4]] // // # Select all rows, two segments. // tf.sparse_segment_sum(c, tf.constant([0, 1, 2]), tf.constant([0, 0, 1])) // ==> [[0 0 0 0] // [5 6 7 8]] // // # Which is equivalent to: // tf.segment_sum(c, tf.constant([0, 0, 1])) // ``` // // Arguments: // * indices: A 1-D tensor. Has same rank as `segment_ids`. // * segment_ids: A 1-D tensor. Values should be sorted and can be repeated. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Has same shape as data, except for dimension 0 which // has size `k`, the number of segments. @Namespace("tensorflow::ops") public static native Node SparseSegmentSum(@ByVal NodeBuilder.NodeOut data, @ByVal NodeBuilder.NodeOut indices, @ByVal NodeBuilder.NodeOut segment_ids, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SparseSegmentSum(Node data, Node indices, Node segment_ids, @Const @ByRef GraphDefBuilder.Options opts); // Computes square root of x element-wise. // // I.e., \\(y = \sqrt{x} = x^{1/2}\\). // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Sqrt(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Sqrt(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Computes square of x element-wise. // // I.e., \\(y = x * x = x^2\\). // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Square(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Square(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Returns (x - y)(x - y) element-wise. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node SquaredDifference(@ByVal NodeBuilder.NodeOut x, @ByVal NodeBuilder.NodeOut y, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SquaredDifference(Node x, Node y, @Const @ByRef GraphDefBuilder.Options opts); // Returns x - y element-wise. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Sub(@ByVal NodeBuilder.NodeOut x, @ByVal NodeBuilder.NodeOut y, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Sub(Node x, Node y, @Const @ByRef GraphDefBuilder.Options opts); // Computes the sum of elements across dimensions of a tensor. // // Reduces `input` along the dimensions given in `reduction_indices`. Unless // `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in // `reduction_indices`. If `keep_dims` is true, the reduced dimensions are // retained with length 1. // // Arguments: // * input: The tensor to reduce. // * reduction_indices: The dimensions to reduce. // * opts: // .WithAttr("keep_dims", bool): Defaults to false. // If true, retain reduced dimensions with length 1. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The reduced tensor. @Namespace("tensorflow::ops") public static native Node Sum(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut reduction_indices, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Sum(Node input, Node reduction_indices, @Const @ByRef GraphDefBuilder.Options opts); // Computes hyperbolic tangent of `x` element-wise. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Tanh(@ByVal NodeBuilder.NodeOut x, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Tanh(Node x, @Const @ByRef GraphDefBuilder.Options opts); // Computes the sum along segments of a tensor. // // Read [the section on // Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation // of segments. // // Computes a tensor such that // \\(output_i = \sum_j data_j\\) where sum is over `j` such // that `segment_ids[j] == i`. Unlike `SegmentSum`, `segment_ids` // need not be sorted and need not cover all values in the full // range of valid values. // // If the sum is empty for a given segment ID `i`, `output[i] = 0`. // // `num_segments` should equal the number of distinct segment IDs. // //
// //
// // Arguments: // * segment_ids: A 1-D tensor whose rank is equal to the rank of `data`'s // first dimension. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Has same shape as data, except for dimension 0 which // has size `num_segments`. @Namespace("tensorflow::ops") public static native Node UnsortedSegmentSum(@ByVal NodeBuilder.NodeOut data, @ByVal NodeBuilder.NodeOut segment_ids, @ByVal NodeBuilder.NodeOut num_segments, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node UnsortedSegmentSum(Node data, Node segment_ids, Node num_segments, @Const @ByRef GraphDefBuilder.Options opts); // namespace ops // namespace tensorflow // #endif // TENSORFLOW_CC_OPS_MATH_OPS_H_ // Parsed from tensorflow/cc/ops/nn_ops.h // This file is MACHINE GENERATED! Do not edit. // #ifndef TENSORFLOW_CC_OPS_NN_OPS_H_ // #define TENSORFLOW_CC_OPS_NN_OPS_H_ // #include "tensorflow/core/framework/tensor.h" // #include "tensorflow/core/framework/tensor_shape.h" // #include "tensorflow/core/framework/types.h" // #include "tensorflow/core/graph/graph_def_builder.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // These add a node to the graph from opts. // // Note for "NodeOut" inputs, you will typically either pass // * a {Node*, int index} (to pass the index-th output of that node), or // * a Node* (to pass the first output of that node). // Performs average pooling on the input. // // Each entry in `output` is the mean of the corresponding size `ksize` // window in `value`. // // Arguments: // * value: 4-D with shape `[batch, height, width, channels]`. // * ksize: The size of the sliding window for each dimension of `value`. // * strides: The stride of the sliding window for each dimension of `value`. // * padding: The type of padding algorithm to use. // * opts: // .WithAttr("data_format", StringPiece): Defaults to "NHWC". // Specify the data format of the input and output data. With the // default format "NHWC", the data is stored in the order of: // [batch, in_height, in_width, in_channels]. // Alternatively, the format could be "NCHW", the data storage order of: // [batch, in_channels, in_height, in_width]. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The average pooled output tensor. @Namespace("tensorflow::ops") public static native Node AvgPool(@ByVal NodeBuilder.NodeOut value, @ArraySlice IntPointer ksize, @ArraySlice IntPointer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node AvgPool(Node value, @ArraySlice IntBuffer ksize, @ArraySlice IntBuffer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node AvgPool(@ByVal NodeBuilder.NodeOut value, @ArraySlice int[] ksize, @ArraySlice int[] strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node AvgPool(Node value, @ArraySlice IntPointer ksize, @ArraySlice IntPointer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node AvgPool(@ByVal NodeBuilder.NodeOut value, @ArraySlice IntBuffer ksize, @ArraySlice IntBuffer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node AvgPool(Node value, @ArraySlice int[] ksize, @ArraySlice int[] strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); // Computes gradients of the average pooling function. // // Arguments: // * orig_input_shape: 1-D. Shape of the original input to `avg_pool`. // * grad: 4-D with shape `[batch, height, width, channels]`. Gradients w.r.t. // the output of `avg_pool`. // * ksize: The size of the sliding window for each dimension of the input. // * strides: The stride of the sliding window for each dimension of the input. // * padding: The type of padding algorithm to use. // * opts: // .WithAttr("data_format", StringPiece): Defaults to "NHWC". // Specify the data format of the input and output data. With the // default format "NHWC", the data is stored in the order of: // [batch, in_height, in_width, in_channels]. // Alternatively, the format could be "NCHW", the data storage order of: // [batch, in_channels, in_height, in_width]. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 4-D. Gradients w.r.t. the input of `avg_pool`. @Namespace("tensorflow::ops") public static native Node AvgPoolGrad(@ByVal NodeBuilder.NodeOut orig_input_shape, @ByVal NodeBuilder.NodeOut grad, @ArraySlice IntPointer ksize, @ArraySlice IntPointer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node AvgPoolGrad(Node orig_input_shape, Node grad, @ArraySlice IntBuffer ksize, @ArraySlice IntBuffer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node AvgPoolGrad(@ByVal NodeBuilder.NodeOut orig_input_shape, @ByVal NodeBuilder.NodeOut grad, @ArraySlice int[] ksize, @ArraySlice int[] strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node AvgPoolGrad(Node orig_input_shape, Node grad, @ArraySlice IntPointer ksize, @ArraySlice IntPointer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node AvgPoolGrad(@ByVal NodeBuilder.NodeOut orig_input_shape, @ByVal NodeBuilder.NodeOut grad, @ArraySlice IntBuffer ksize, @ArraySlice IntBuffer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node AvgPoolGrad(Node orig_input_shape, Node grad, @ArraySlice int[] ksize, @ArraySlice int[] strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); // Batch normalization. // // This op is deprecated. Prefer `tf.nn.batch_normalization`. // // Arguments: // * t: A 4D input Tensor. // * m: A 1D mean Tensor with size matching the last dimension of t. // This is the first output from tf.nn.moments, // or a saved moving average thereof. // * v: A 1D variance Tensor with size matching the last dimension of t. // This is the second output from tf.nn.moments, // or a saved moving average thereof. // * beta: A 1D beta Tensor with size matching the last dimension of t. // An offset to be added to the normalized tensor. // * gamma: A 1D gamma Tensor with size matching the last dimension of t. // If "scale_after_normalization" is true, this tensor will be multiplied // with the normalized tensor. // * variance_epsilon: A small float number to avoid dividing by 0. // * scale_after_normalization: A bool indicating whether the resulted tensor // needs to be multiplied with gamma. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node BatchNormWithGlobalNormalization(@ByVal NodeBuilder.NodeOut t, @ByVal NodeBuilder.NodeOut m, @ByVal NodeBuilder.NodeOut v, @ByVal NodeBuilder.NodeOut beta, @ByVal NodeBuilder.NodeOut gamma, float variance_epsilon, @Cast("bool") boolean scale_after_normalization, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BatchNormWithGlobalNormalization(Node t, Node m, Node v, Node beta, Node gamma, float variance_epsilon, @Cast("bool") boolean scale_after_normalization, @Const @ByRef GraphDefBuilder.Options opts); // Gradients for batch normalization. // // This op is deprecated. See `tf.nn.batch_normalization`. // // Arguments: // * t: A 4D input Tensor. // * m: A 1D mean Tensor with size matching the last dimension of t. // This is the first output from tf.nn.moments, // or a saved moving average thereof. // * v: A 1D variance Tensor with size matching the last dimension of t. // This is the second output from tf.nn.moments, // or a saved moving average thereof. // * gamma: A 1D gamma Tensor with size matching the last dimension of t. // If "scale_after_normalization" is true, this Tensor will be multiplied // with the normalized Tensor. // * backprop: 4D backprop Tensor. // * variance_epsilon: A small float number to avoid dividing by 0. // * scale_after_normalization: A bool indicating whether the resulted tensor // needs to be multiplied with gamma. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * dx: 4D backprop tensor for input. // * dm: 1D backprop tensor for mean. // * dv: 1D backprop tensor for variance. // * db: 1D backprop tensor for beta. // * dg: 1D backprop tensor for gamma. @Namespace("tensorflow::ops") public static native Node BatchNormWithGlobalNormalizationGrad(@ByVal NodeBuilder.NodeOut t, @ByVal NodeBuilder.NodeOut m, @ByVal NodeBuilder.NodeOut v, @ByVal NodeBuilder.NodeOut gamma, @ByVal NodeBuilder.NodeOut backprop, float variance_epsilon, @Cast("bool") boolean scale_after_normalization, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BatchNormWithGlobalNormalizationGrad(Node t, Node m, Node v, Node gamma, Node backprop, float variance_epsilon, @Cast("bool") boolean scale_after_normalization, @Const @ByRef GraphDefBuilder.Options opts); // Adds `bias` to `value`. // // This is a special case of `tf.add` where `bias` is restricted to be 1-D. // Broadcasting is supported, so `value` may have any number of dimensions. // // Arguments: // * value: Any number of dimensions. // * bias: 1-D with size the last dimension of `value`. // * opts: // .WithAttr("data_format", StringPiece): Defaults to "NHWC". // Specify the data format of the input and output data. With the // default format "NHWC", the bias tensor will be added to the last dimension // of the value tensor. // Alternatively, the format could be "NCHW", the data storage order of: // [batch, in_channels, in_height, in_width]. // The tensor will be added to "in_channels", the third-to-the-last // dimension. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Broadcasted sum of `value` and `bias`. @Namespace("tensorflow::ops") public static native Node BiasAdd(@ByVal NodeBuilder.NodeOut value, @ByVal NodeBuilder.NodeOut bias, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BiasAdd(Node value, Node bias, @Const @ByRef GraphDefBuilder.Options opts); // The backward operation for "BiasAdd" on the "bias" tensor. // // It accumulates all the values from out_backprop into the feature dimension. // For NHWC data format, the feature dimension is the last. For NCHW data format, // the feature dimension is the third-to-last. // // Arguments: // * out_backprop: Any number of dimensions. // * opts: // .WithAttr("data_format", StringPiece): Defaults to "NHWC". // Specify the data format of the input and output data. With the // default format "NHWC", the bias tensor will be added to the last dimension // of the value tensor. // Alternatively, the format could be "NCHW", the data storage order of: // [batch, in_channels, in_height, in_width]. // The tensor will be added to "in_channels", the third-to-the-last // dimension. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 1-D with size the feature dimension of `out_backprop`. @Namespace("tensorflow::ops") public static native Node BiasAddGrad(@ByVal NodeBuilder.NodeOut out_backprop, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BiasAddGrad(Node out_backprop, @Const @ByRef GraphDefBuilder.Options opts); // Adds `bias` to `value`. // // This is a deprecated version of BiasAdd and will be soon removed. // // This is a special case of `tf.add` where `bias` is restricted to be 1-D. // Broadcasting is supported, so `value` may have any number of dimensions. // // Arguments: // * value: Any number of dimensions. // * bias: 1-D with size the last dimension of `value`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Broadcasted sum of `value` and `bias`. @Namespace("tensorflow::ops") public static native Node BiasAddV1(@ByVal NodeBuilder.NodeOut value, @ByVal NodeBuilder.NodeOut bias, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node BiasAddV1(Node value, Node bias, @Const @ByRef GraphDefBuilder.Options opts); // Computes a 2-D convolution given 4-D `input` and `filter` tensors. // // Given an input tensor of shape `[batch, in_height, in_width, in_channels]` // and a filter / kernel tensor of shape // `[filter_height, filter_width, in_channels, out_channels]`, this op // performs the following: // // 1. Flattens the filter to a 2-D matrix with shape // `[filter_height * filter_width * in_channels, output_channels]`. // 2. Extracts image patches from the input tensor to form a *virtual* // tensor of shape `[batch, out_height, out_width, // filter_height * filter_width * in_channels]`. // 3. For each patch, right-multiplies the filter matrix and the image patch // vector. // // In detail, with the default NHWC format, // // output[b, i, j, k] = // sum_{di, dj, q} input[b, strides[1] * i + di, strides[2] * j + dj, q] * // filter[di, dj, q, k] // // Must have `strides[0] = strides[3] = 1`. For the most common case of the same // horizontal and vertices strides, `strides = [1, stride, stride, 1]`. // // Arguments: // * strides: 1-D of length 4. The stride of the sliding window for each dimension // of `input`. Must be in the same order as the dimension specified with format. // * padding: The type of padding algorithm to use. // * opts: // .WithAttr("use_cudnn_on_gpu", bool): Defaults to true. // .WithAttr("data_format", StringPiece): Defaults to "NHWC". // Specify the data format of the input and output data. With the // default format "NHWC", the data is stored in the order of: // [batch, in_height, in_width, in_channels]. // Alternatively, the format could be "NCHW", the data storage order of: // [batch, in_channels, in_height, in_width]. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Conv2D(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut filter, @ArraySlice IntPointer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Conv2D(Node input, Node filter, @ArraySlice IntBuffer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Conv2D(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut filter, @ArraySlice int[] strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Conv2D(Node input, Node filter, @ArraySlice IntPointer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Conv2D(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut filter, @ArraySlice IntBuffer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Conv2D(Node input, Node filter, @ArraySlice int[] strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); // Computes the gradients of convolution with respect to the filter. // // Arguments: // * input: 4-D with shape `[batch, in_height, in_width, in_channels]`. // * filter_sizes: An integer vector representing the tensor shape of `filter`, // where `filter` is a 4-D // `[filter_height, filter_width, in_channels, out_channels]` tensor. // * out_backprop: 4-D with shape `[batch, out_height, out_width, out_channels]`. // Gradients w.r.t. the output of the convolution. // * strides: The stride of the sliding window for each dimension of the input // of the convolution. Must be in the same order as the dimension specified with // format. // * padding: The type of padding algorithm to use. // * opts: // .WithAttr("use_cudnn_on_gpu", bool): Defaults to true. // .WithAttr("data_format", StringPiece): Defaults to "NHWC". // Specify the data format of the input and output data. With the // default format "NHWC", the data is stored in the order of: // [batch, in_height, in_width, in_channels]. // Alternatively, the format could be "NCHW", the data storage order of: // [batch, in_channels, in_height, in_width]. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 4-D with shape // `[filter_height, filter_width, in_channels, out_channels]`. Gradient w.r.t. // the `filter` input of the convolution. @Namespace("tensorflow::ops") public static native Node Conv2DBackpropFilter(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut filter_sizes, @ByVal NodeBuilder.NodeOut out_backprop, @ArraySlice IntPointer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Conv2DBackpropFilter(Node input, Node filter_sizes, Node out_backprop, @ArraySlice IntBuffer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Conv2DBackpropFilter(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut filter_sizes, @ByVal NodeBuilder.NodeOut out_backprop, @ArraySlice int[] strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Conv2DBackpropFilter(Node input, Node filter_sizes, Node out_backprop, @ArraySlice IntPointer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Conv2DBackpropFilter(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut filter_sizes, @ByVal NodeBuilder.NodeOut out_backprop, @ArraySlice IntBuffer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Conv2DBackpropFilter(Node input, Node filter_sizes, Node out_backprop, @ArraySlice int[] strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); // Computes the gradients of convolution with respect to the input. // // Arguments: // * input_sizes: An integer vector representing the shape of `input`, // where `input` is a 4-D `[batch, height, width, channels]` tensor. // * filter: 4-D with shape // `[filter_height, filter_width, in_channels, out_channels]`. // * out_backprop: 4-D with shape `[batch, out_height, out_width, out_channels]`. // Gradients w.r.t. the output of the convolution. // * strides: The stride of the sliding window for each dimension of the input // of the convolution. Must be in the same order as the dimension specified with // format. // * padding: The type of padding algorithm to use. // * opts: // .WithAttr("use_cudnn_on_gpu", bool): Defaults to true. // .WithAttr("data_format", StringPiece): Defaults to "NHWC". // Specify the data format of the input and output data. With the // default format "NHWC", the data is stored in the order of: // [batch, in_height, in_width, in_channels]. // Alternatively, the format could be "NCHW", the data storage order of: // [batch, in_channels, in_height, in_width]. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 4-D with shape `[batch, in_height, in_width, in_channels]`. Gradient // w.r.t. the input of the convolution. @Namespace("tensorflow::ops") public static native Node Conv2DBackpropInput(@ByVal NodeBuilder.NodeOut input_sizes, @ByVal NodeBuilder.NodeOut filter, @ByVal NodeBuilder.NodeOut out_backprop, @ArraySlice IntPointer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Conv2DBackpropInput(Node input_sizes, Node filter, Node out_backprop, @ArraySlice IntBuffer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Conv2DBackpropInput(@ByVal NodeBuilder.NodeOut input_sizes, @ByVal NodeBuilder.NodeOut filter, @ByVal NodeBuilder.NodeOut out_backprop, @ArraySlice int[] strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Conv2DBackpropInput(Node input_sizes, Node filter, Node out_backprop, @ArraySlice IntPointer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Conv2DBackpropInput(@ByVal NodeBuilder.NodeOut input_sizes, @ByVal NodeBuilder.NodeOut filter, @ByVal NodeBuilder.NodeOut out_backprop, @ArraySlice IntBuffer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Conv2DBackpropInput(Node input_sizes, Node filter, Node out_backprop, @ArraySlice int[] strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); // Computes a 2-D depthwise convolution given 4-D `input` and `filter` tensors. // // Given an input tensor of shape `[batch, in_height, in_width, in_channels]` // and a filter / kernel tensor of shape // `[filter_height, filter_width, in_channels, channel_multiplier]`, containing // `in_channels` convolutional filters of depth 1, `depthwise_conv2d` applies // a different filter to each input channel (expanding from 1 channel to // `channel_multiplier` channels for each), then concatenates the results // together. Thus, the output has `in_channels * channel_multiplier` channels. // // for k in 0..in_channels-1 // for q in 0..channel_multiplier-1 // output[b, i, j, k * channel_multiplier + q] = // sum_{di, dj} input[b, strides[1] * i + di, strides[2] * j + dj, k] * // filter[di, dj, k, q] // // Must have `strides[0] = strides[3] = 1`. For the most common case of the same // horizontal and vertices strides, `strides = [1, stride, stride, 1]`. // // Arguments: // * strides: 1-D of length 4. The stride of the sliding window for each dimension // of `input`. // * padding: The type of padding algorithm to use. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node DepthwiseConv2dNative(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut filter, @ArraySlice IntPointer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DepthwiseConv2dNative(Node input, Node filter, @ArraySlice IntBuffer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DepthwiseConv2dNative(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut filter, @ArraySlice int[] strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DepthwiseConv2dNative(Node input, Node filter, @ArraySlice IntPointer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DepthwiseConv2dNative(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut filter, @ArraySlice IntBuffer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DepthwiseConv2dNative(Node input, Node filter, @ArraySlice int[] strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); // Computes the gradients of depthwise convolution with respect to the filter. // // Arguments: // * input: 4-D with shape `[batch, in_height, in_width, in_channels]`. // * filter_sizes: An integer vector representing the tensor shape of `filter`, // where `filter` is a 4-D // `[filter_height, filter_width, in_channels, depthwise_multiplier]` tensor. // * out_backprop: 4-D with shape `[batch, out_height, out_width, out_channels]`. // Gradients w.r.t. the output of the convolution. // * strides: The stride of the sliding window for each dimension of the input // of the convolution. // * padding: The type of padding algorithm to use. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 4-D with shape // `[filter_height, filter_width, in_channels, out_channels]`. Gradient w.r.t. // the `filter` input of the convolution. @Namespace("tensorflow::ops") public static native Node DepthwiseConv2dNativeBackpropFilter(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut filter_sizes, @ByVal NodeBuilder.NodeOut out_backprop, @ArraySlice IntPointer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DepthwiseConv2dNativeBackpropFilter(Node input, Node filter_sizes, Node out_backprop, @ArraySlice IntBuffer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DepthwiseConv2dNativeBackpropFilter(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut filter_sizes, @ByVal NodeBuilder.NodeOut out_backprop, @ArraySlice int[] strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DepthwiseConv2dNativeBackpropFilter(Node input, Node filter_sizes, Node out_backprop, @ArraySlice IntPointer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DepthwiseConv2dNativeBackpropFilter(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut filter_sizes, @ByVal NodeBuilder.NodeOut out_backprop, @ArraySlice IntBuffer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DepthwiseConv2dNativeBackpropFilter(Node input, Node filter_sizes, Node out_backprop, @ArraySlice int[] strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); // Computes the gradients of depthwise convolution with respect to the input. // // Arguments: // * input_sizes: An integer vector representing the shape of `input`, // where `input` is a 4-D `[batch, height, width, channels]` tensor. // * filter: 4-D with shape // `[filter_height, filter_width, in_channels, depthwise_multiplier]`. // * out_backprop: 4-D with shape `[batch, out_height, out_width, out_channels]`. // Gradients w.r.t. the output of the convolution. // * strides: The stride of the sliding window for each dimension of the input // of the convolution. // * padding: The type of padding algorithm to use. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 4-D with shape `[batch, in_height, in_width, in_channels]`. Gradient // w.r.t. the input of the convolution. @Namespace("tensorflow::ops") public static native Node DepthwiseConv2dNativeBackpropInput(@ByVal NodeBuilder.NodeOut input_sizes, @ByVal NodeBuilder.NodeOut filter, @ByVal NodeBuilder.NodeOut out_backprop, @ArraySlice IntPointer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DepthwiseConv2dNativeBackpropInput(Node input_sizes, Node filter, Node out_backprop, @ArraySlice IntBuffer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DepthwiseConv2dNativeBackpropInput(@ByVal NodeBuilder.NodeOut input_sizes, @ByVal NodeBuilder.NodeOut filter, @ByVal NodeBuilder.NodeOut out_backprop, @ArraySlice int[] strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DepthwiseConv2dNativeBackpropInput(Node input_sizes, Node filter, Node out_backprop, @ArraySlice IntPointer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DepthwiseConv2dNativeBackpropInput(@ByVal NodeBuilder.NodeOut input_sizes, @ByVal NodeBuilder.NodeOut filter, @ByVal NodeBuilder.NodeOut out_backprop, @ArraySlice IntBuffer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DepthwiseConv2dNativeBackpropInput(Node input_sizes, Node filter, Node out_backprop, @ArraySlice int[] strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); // Computes exponential linear: `exp(features) - 1` if < 0, `features` otherwise. // // See [Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs) // ](http://arxiv.org/abs/1511.07289) // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Elu(@ByVal NodeBuilder.NodeOut features, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Elu(Node features, @Const @ByRef GraphDefBuilder.Options opts); // Computes gradients for the exponential linear (Elu) operation. // // Arguments: // * gradients: The backpropagated gradients to the corresponding Elu operation. // * outputs: The outputs of the corresponding Elu operation. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The gradients: `gradients * (outputs + 1)` if outputs < 0, // `gradients` otherwise. @Namespace("tensorflow::ops") public static native Node EluGrad(@ByVal NodeBuilder.NodeOut gradients, @ByVal NodeBuilder.NodeOut outputs, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node EluGrad(Node gradients, Node outputs, @Const @ByRef GraphDefBuilder.Options opts); // Says whether the targets are in the top `K` predictions. // // This outputs a `batch_size` bool array, an entry `out[i]` is `true` if the // prediction for the target class is among the top `k` predictions among // all predictions for example `i`. Note that the behavior of `InTopK` differs // from the `TopK` op in its handling of ties; if multiple classes have the // same prediction value and straddle the top-`k` boundary, all of those // classes are considered to be in the top `k`. // // More formally, let // // \\(predictions_i\\) be the predictions for all classes for example `i`, // \\(targets_i\\) be the target class for example `i`, // \\(out_i\\) be the output for example `i`, // // $$out_i = predictions_{i, targets_i} \in TopKIncludingTies(predictions_i)$$ // // Arguments: // * predictions: A `batch_size` x `classes` tensor. // * targets: A `batch_size` vector of class ids. // * k: Number of top elements to look at for computing precision. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Computed Precision at `k` as a `bool Tensor`. @Namespace("tensorflow::ops") public static native Node InTopK(@ByVal NodeBuilder.NodeOut predictions, @ByVal NodeBuilder.NodeOut targets, @Cast("tensorflow::int64") long k, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node InTopK(Node predictions, Node targets, @Cast("tensorflow::int64") long k, @Const @ByRef GraphDefBuilder.Options opts); // L2 Loss. // // Computes half the L2 norm of a tensor without the `sqrt`: // // output = sum(t ** 2) / 2 // // Arguments: // * t: Typically 2-D, but may have any dimensions. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // 0-D. @Namespace("tensorflow::ops") public static native Node L2Loss(@ByVal NodeBuilder.NodeOut t, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node L2Loss(Node t, @Const @ByRef GraphDefBuilder.Options opts); // Local Response Normalization. // // The 4-D `input` tensor is treated as a 3-D array of 1-D vectors (along the last // dimension), and each vector is normalized independently. Within a given vector, // each component is divided by the weighted, squared sum of inputs within // `depth_radius`. In detail, // // sqr_sum[a, b, c, d] = // sum(input[a, b, c, d - depth_radius : d + depth_radius + 1] ** 2) // output = input / (bias + alpha * sqr_sum) ** beta // // For details, see [Krizhevsky et al., ImageNet classification with deep // convolutional neural networks (NIPS 2012)] // (http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks). // // Arguments: // * input: 4-D. // * opts: // .WithAttr("depth_radius", int64): Defaults to 5. // 0-D. Half-width of the 1-D normalization window. // .WithAttr("bias", float): Defaults to 1. // An offset (usually positive to avoid dividing by 0). // .WithAttr("alpha", float): Defaults to 1. // A scale factor, usually positive. // .WithAttr("beta", float): Defaults to 0.5. // An exponent. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node LRN(@ByVal NodeBuilder.NodeOut input, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node LRN(Node input, @Const @ByRef GraphDefBuilder.Options opts); // Gradients for Local Response Normalization. // // Arguments: // * input_grads: 4-D with shape `[batch, height, width, channels]`. // * input_image: 4-D with shape `[batch, height, width, channels]`. // * output_image: 4-D with shape `[batch, height, width, channels]`. // * opts: // .WithAttr("depth_radius", int64): Defaults to 5. // A depth radius. // .WithAttr("bias", float): Defaults to 1. // An offset (usually > 0 to avoid dividing by 0). // .WithAttr("alpha", float): Defaults to 1. // A scale factor, usually positive. // .WithAttr("beta", float): Defaults to 0.5. // An exponent. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The gradients for LRN. @Namespace("tensorflow::ops") public static native Node LRNGrad(@ByVal NodeBuilder.NodeOut input_grads, @ByVal NodeBuilder.NodeOut input_image, @ByVal NodeBuilder.NodeOut output_image, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node LRNGrad(Node input_grads, Node input_image, Node output_image, @Const @ByRef GraphDefBuilder.Options opts); // Computes log softmax activations. // // For each batch `i` and class `j` we have // // logsoftmax[i, j] = logits[i, j] - log(sum(exp(logits[i]))) // // Arguments: // * logits: 2-D with shape `[batch_size, num_classes]`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Same shape as `logits`. @Namespace("tensorflow::ops") public static native Node LogSoftmax(@ByVal NodeBuilder.NodeOut logits, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node LogSoftmax(Node logits, @Const @ByRef GraphDefBuilder.Options opts); // Performs max pooling on the input. // // Arguments: // * input: 4-D input to pool over. // * ksize: The size of the window for each dimension of the input tensor. // * strides: The stride of the sliding window for each dimension of the // input tensor. // * padding: The type of padding algorithm to use. // * opts: // .WithAttr("data_format", StringPiece): Defaults to "NHWC". // Specify the data format of the input and output data. With the // default format "NHWC", the data is stored in the order of: // [batch, in_height, in_width, in_channels]. // Alternatively, the format could be "NCHW", the data storage order of: // [batch, in_channels, in_height, in_width]. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The max pooled output tensor. @Namespace("tensorflow::ops") public static native Node MaxPool(@ByVal NodeBuilder.NodeOut input, @ArraySlice IntPointer ksize, @ArraySlice IntPointer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MaxPool(Node input, @ArraySlice IntBuffer ksize, @ArraySlice IntBuffer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MaxPool(@ByVal NodeBuilder.NodeOut input, @ArraySlice int[] ksize, @ArraySlice int[] strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MaxPool(Node input, @ArraySlice IntPointer ksize, @ArraySlice IntPointer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MaxPool(@ByVal NodeBuilder.NodeOut input, @ArraySlice IntBuffer ksize, @ArraySlice IntBuffer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MaxPool(Node input, @ArraySlice int[] ksize, @ArraySlice int[] strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); // Computes gradients of the maxpooling function. // // Arguments: // * orig_input: The original input tensor. // * orig_output: The original output tensor. // * grad: 4-D. Gradients w.r.t. the output of `max_pool`. // * ksize: The size of the window for each dimension of the input tensor. // * strides: The stride of the sliding window for each dimension of the // input tensor. // * padding: The type of padding algorithm to use. // * opts: // .WithAttr("data_format", StringPiece): Defaults to "NHWC". // Specify the data format of the input and output data. With the // default format "NHWC", the data is stored in the order of: // [batch, in_height, in_width, in_channels]. // Alternatively, the format could be "NCHW", the data storage order of: // [batch, in_channels, in_height, in_width]. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Gradients w.r.t. the input to `max_pool`. @Namespace("tensorflow::ops") public static native Node MaxPoolGrad(@ByVal NodeBuilder.NodeOut orig_input, @ByVal NodeBuilder.NodeOut orig_output, @ByVal NodeBuilder.NodeOut grad, @ArraySlice IntPointer ksize, @ArraySlice IntPointer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MaxPoolGrad(Node orig_input, Node orig_output, Node grad, @ArraySlice IntBuffer ksize, @ArraySlice IntBuffer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MaxPoolGrad(@ByVal NodeBuilder.NodeOut orig_input, @ByVal NodeBuilder.NodeOut orig_output, @ByVal NodeBuilder.NodeOut grad, @ArraySlice int[] ksize, @ArraySlice int[] strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MaxPoolGrad(Node orig_input, Node orig_output, Node grad, @ArraySlice IntPointer ksize, @ArraySlice IntPointer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MaxPoolGrad(@ByVal NodeBuilder.NodeOut orig_input, @ByVal NodeBuilder.NodeOut orig_output, @ByVal NodeBuilder.NodeOut grad, @ArraySlice IntBuffer ksize, @ArraySlice IntBuffer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MaxPoolGrad(Node orig_input, Node orig_output, Node grad, @ArraySlice int[] ksize, @ArraySlice int[] strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); // Computes gradients of the maxpooling function. // // Arguments: // * input: The original input. // * grad: 4-D with shape `[batch, height, width, channels]`. Gradients w.r.t. the // output of `max_pool`. // * argmax: The indices of the maximum values chosen for each output of `max_pool`. // * ksize: The size of the window for each dimension of the input tensor. // * strides: The stride of the sliding window for each dimension of the // input tensor. // * padding: The type of padding algorithm to use. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Gradients w.r.t. the input of `max_pool`. @Namespace("tensorflow::ops") public static native Node MaxPoolGradWithArgmax(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut grad, @ByVal NodeBuilder.NodeOut argmax, @ArraySlice IntPointer ksize, @ArraySlice IntPointer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MaxPoolGradWithArgmax(Node input, Node grad, Node argmax, @ArraySlice IntBuffer ksize, @ArraySlice IntBuffer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MaxPoolGradWithArgmax(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut grad, @ByVal NodeBuilder.NodeOut argmax, @ArraySlice int[] ksize, @ArraySlice int[] strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MaxPoolGradWithArgmax(Node input, Node grad, Node argmax, @ArraySlice IntPointer ksize, @ArraySlice IntPointer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MaxPoolGradWithArgmax(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut grad, @ByVal NodeBuilder.NodeOut argmax, @ArraySlice IntBuffer ksize, @ArraySlice IntBuffer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MaxPoolGradWithArgmax(Node input, Node grad, Node argmax, @ArraySlice int[] ksize, @ArraySlice int[] strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); // Performs max pooling on the input and outputs both max values and indices. // // The indices in `argmax` are flattened, so that a maximum value at position // `[b, y, x, c]` becomes flattened index // `((b * height + y) * width + x) * channels + c`. // // Arguments: // * input: 4-D with shape `[batch, height, width, channels]`. Input to pool over. // * ksize: The size of the window for each dimension of the input tensor. // * strides: The stride of the sliding window for each dimension of the // input tensor. // * padding: The type of padding algorithm to use. // * opts: // .WithAttr("Targmax", DataType): Defaults to DT_INT64. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * output: The max pooled output tensor. // * argmax: 4-D. The flattened indices of the max values chosen for each output. @Namespace("tensorflow::ops") public static native Node MaxPoolWithArgmax(@ByVal NodeBuilder.NodeOut input, @ArraySlice IntPointer ksize, @ArraySlice IntPointer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MaxPoolWithArgmax(Node input, @ArraySlice IntBuffer ksize, @ArraySlice IntBuffer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MaxPoolWithArgmax(@ByVal NodeBuilder.NodeOut input, @ArraySlice int[] ksize, @ArraySlice int[] strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MaxPoolWithArgmax(Node input, @ArraySlice IntPointer ksize, @ArraySlice IntPointer strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MaxPoolWithArgmax(@ByVal NodeBuilder.NodeOut input, @ArraySlice IntBuffer ksize, @ArraySlice IntBuffer strides, @StringPiece BytePointer padding, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node MaxPoolWithArgmax(Node input, @ArraySlice int[] ksize, @ArraySlice int[] strides, @StringPiece String padding, @Const @ByRef GraphDefBuilder.Options opts); // Computes rectified linear: `max(features, 0)`. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Relu(@ByVal NodeBuilder.NodeOut features, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Relu(Node features, @Const @ByRef GraphDefBuilder.Options opts); // Computes rectified linear 6: `min(max(features, 0), 6)`. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Relu6(@ByVal NodeBuilder.NodeOut features, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Relu6(Node features, @Const @ByRef GraphDefBuilder.Options opts); // Computes rectified linear 6 gradients for a Relu6 operation. // // Arguments: // * gradients: The backpropagated gradients to the corresponding Relu6 operation. // * features: The features passed as input to the corresponding Relu6 operation. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The gradients: // `gradients * features * (features > 0) * (features < 6)`. @Namespace("tensorflow::ops") public static native Node Relu6Grad(@ByVal NodeBuilder.NodeOut gradients, @ByVal NodeBuilder.NodeOut features, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Relu6Grad(Node gradients, Node features, @Const @ByRef GraphDefBuilder.Options opts); // Computes rectified linear gradients for a Relu operation. // // Arguments: // * gradients: The backpropagated gradients to the corresponding Relu operation. // * features: The features passed as input to the corresponding Relu operation, OR // the outputs of that operation (both work equivalently). // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // `gradients * (features > 0)`. @Namespace("tensorflow::ops") public static native Node ReluGrad(@ByVal NodeBuilder.NodeOut gradients, @ByVal NodeBuilder.NodeOut features, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ReluGrad(Node gradients, Node features, @Const @ByRef GraphDefBuilder.Options opts); // Computes softmax activations. // // For each batch `i` and class `j` we have // // softmax[i, j] = exp(logits[i, j]) / sum(exp(logits[i])) // // Arguments: // * logits: 2-D with shape `[batch_size, num_classes]`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Same shape as `logits`. @Namespace("tensorflow::ops") public static native Node Softmax(@ByVal NodeBuilder.NodeOut logits, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Softmax(Node logits, @Const @ByRef GraphDefBuilder.Options opts); // Computes softmax cross entropy cost and gradients to backpropagate. // // Inputs are the logits, not probabilities. // // Arguments: // * features: batch_size x num_classes matrix // * labels: batch_size x num_classes matrix // The caller must ensure that each batch of labels represents a valid // probability distribution. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * loss: Per example loss (batch_size vector). // * backprop: backpropagated gradients (batch_size x num_classes matrix). @Namespace("tensorflow::ops") public static native Node SoftmaxCrossEntropyWithLogits(@ByVal NodeBuilder.NodeOut features, @ByVal NodeBuilder.NodeOut labels, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SoftmaxCrossEntropyWithLogits(Node features, Node labels, @Const @ByRef GraphDefBuilder.Options opts); // Computes softplus: `log(exp(features) + 1)`. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Softplus(@ByVal NodeBuilder.NodeOut features, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Softplus(Node features, @Const @ByRef GraphDefBuilder.Options opts); // Computes softplus gradients for a softplus operation. // // Arguments: // * gradients: The backpropagated gradients to the corresponding softplus operation. // * features: The features passed as input to the corresponding softplus operation. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The gradients: `gradients / (1 + exp(-features))`. @Namespace("tensorflow::ops") public static native Node SoftplusGrad(@ByVal NodeBuilder.NodeOut gradients, @ByVal NodeBuilder.NodeOut features, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SoftplusGrad(Node gradients, Node features, @Const @ByRef GraphDefBuilder.Options opts); // Computes softsign: `features / (abs(features) + 1)`. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Softsign(@ByVal NodeBuilder.NodeOut features, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Softsign(Node features, @Const @ByRef GraphDefBuilder.Options opts); // Computes softsign gradients for a softsign operation. // // Arguments: // * gradients: The backpropagated gradients to the corresponding softsign operation. // * features: The features passed as input to the corresponding softsign operation. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // The gradients: `gradients / (1 + abs(-features)) ** 2`. @Namespace("tensorflow::ops") public static native Node SoftsignGrad(@ByVal NodeBuilder.NodeOut gradients, @ByVal NodeBuilder.NodeOut features, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SoftsignGrad(Node gradients, Node features, @Const @ByRef GraphDefBuilder.Options opts); // Computes softmax cross entropy cost and gradients to backpropagate. // // Unlike `SoftmaxCrossEntropyWithLogits`, this operation does not accept // a matrix of label probabilities, but rather a single label per row // of features. This label is considered to have probability 1.0 for the // given row. // // Inputs are the logits, not probabilities. // // Arguments: // * features: batch_size x num_classes matrix // * labels: batch_size vector with values in [0, num_classes). // This is the label for the given minibatch entry. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * loss: Per example loss (batch_size vector). // * backprop: backpropagated gradients (batch_size x num_classes matrix). @Namespace("tensorflow::ops") public static native Node SparseSoftmaxCrossEntropyWithLogits(@ByVal NodeBuilder.NodeOut features, @ByVal NodeBuilder.NodeOut labels, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SparseSoftmaxCrossEntropyWithLogits(Node features, Node labels, @Const @ByRef GraphDefBuilder.Options opts); // Finds values and indices of the `k` largest elements for the last dimension. // // If the input is a vector (rank-1), finds the `k` largest entries in the vector // and outputs their values and indices as vectors. Thus `values[j]` is the // `j`-th largest entry in `input`, and its index is `indices[j]`. // // For matrices (resp. higher rank input), computes the top `k` entries in each // row (resp. vector along the last dimension). Thus, // // values.shape = indices.shape = input.shape[:-1] + [k] // // If two elements are equal, the lower-index element appears first. // // If `k` varies dynamically, use `TopKV2` below. // // Arguments: // * input: 1-D or higher with last dimension at least `k`. // * k: Number of top elements to look for along the last dimension (along each // row for matrices). // * opts: // .WithAttr("sorted", bool): Defaults to true. // If true the resulting `k` elements will be sorted by the values in // descending order. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * values: The `k` largest elements along each last dimensional slice. // * indices: The indices of `values` within the last dimension of `input`. @Namespace("tensorflow::ops") public static native Node TopK(@ByVal NodeBuilder.NodeOut input, @Cast("tensorflow::int64") long k, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node TopK(Node input, @Cast("tensorflow::int64") long k, @Const @ByRef GraphDefBuilder.Options opts); // Finds values and indices of the `k` largest elements for the last dimension. // // If the input is a vector (rank-1), finds the `k` largest entries in the vector // and outputs their values and indices as vectors. Thus `values[j]` is the // `j`-th largest entry in `input`, and its index is `indices[j]`. // // For matrices (resp. higher rank input), computes the top `k` entries in each // row (resp. vector along the last dimension). Thus, // // values.shape = indices.shape = input.shape[:-1] + [k] // // If two elements are equal, the lower-index element appears first. // // This is the same as `TopK`, but takes `k` as in input rather than an attr. // // Arguments: // * input: 1-D or higher with last dimension at least `k`. // * k: 0-D. Number of top elements to look for along the last dimension (along each // row for matrices). // * opts: // .WithAttr("sorted", bool): Defaults to true. // If true the resulting `k` elements will be sorted by the values in // descending order. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * values: The `k` largest elements along each last dimensional slice. // * indices: The indices of `values` within the last dimension of `input`. @Namespace("tensorflow::ops") public static native Node TopKV2(@ByVal NodeBuilder.NodeOut input, @ByVal NodeBuilder.NodeOut k, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node TopKV2(Node input, Node k, @Const @ByRef GraphDefBuilder.Options opts); // namespace ops // namespace tensorflow // #endif // TENSORFLOW_CC_OPS_NN_OPS_H_ // Parsed from tensorflow/cc/ops/parsing_ops.h // This file is MACHINE GENERATED! Do not edit. // #ifndef TENSORFLOW_CC_OPS_PARSING_OPS_H_ // #define TENSORFLOW_CC_OPS_PARSING_OPS_H_ // #include "tensorflow/core/framework/tensor.h" // #include "tensorflow/core/framework/tensor_shape.h" // #include "tensorflow/core/framework/types.h" // #include "tensorflow/core/graph/graph_def_builder.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // These add a node to the graph from opts. // // Note for "NodeOut" inputs, you will typically either pass // * a {Node*, int index} (to pass the index-th output of that node), or // * a Node* (to pass the first output of that node). // Convert CSV records to tensors. Each column maps to one tensor. // // RFC 4180 format is expected for the CSV records. // (https://tools.ietf.org/html/rfc4180) // Note that we allow leading and trailing spaces with int or float field. // // Arguments: // * records: Each string is a record/row in the csv and all records should have // the same format. // * record_defaults: One tensor per column of the input record, with either a // scalar default value for that column or empty if the column is required. // * opts: // .WithAttr("field_delim", StringPiece): Defaults to ",". // delimiter to separate fields in a record. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Each tensor will have the same shape as records. @Namespace("tensorflow::ops") public static native Node DecodeCSV(@ByVal NodeBuilder.NodeOut records, @ByVal NodeOutVector record_defaults, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DecodeCSV(Node records, @ByVal NodeOutVector record_defaults, @Const @ByRef GraphDefBuilder.Options opts); // Convert JSON-encoded Example records to binary protocol buffer strings. // // This op translates a tensor containing Example records, encoded using // the [standard JSON // mapping](https://developers.google.com/protocol-buffers/docs/proto3#json), // into a tensor containing the same records encoded as binary protocol // buffers. The resulting tensor can then be fed to any of the other // Example-parsing ops. // // Arguments: // * json_examples: Each string is a JSON object serialized according to the JSON // mapping of the Example proto. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Each string is a binary Example protocol buffer corresponding // to the respective element of `json_examples`. @Namespace("tensorflow::ops") public static native Node DecodeJSONExample(@ByVal NodeBuilder.NodeOut json_examples, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DecodeJSONExample(Node json_examples, @Const @ByRef GraphDefBuilder.Options opts); // Reinterpret the bytes of a string as a vector of numbers. // // Arguments: // * bytes: All the elements must have the same length. // * opts: // .WithAttr("little_endian", bool): Defaults to true. // Whether the input `bytes` are in little-endian order. // Ignored for `out_type` values that are stored in a single byte like // `uint8`. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A Tensor with one more dimension than the input `bytes`. The // added dimension will have size equal to the length of the elements // of `bytes` divided by the number of bytes to represent `out_type`. @Namespace("tensorflow::ops") public static native Node DecodeRaw(@ByVal NodeBuilder.NodeOut bytes, @Cast("tensorflow::DataType") int out_type, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DecodeRaw(Node bytes, @Cast("tensorflow::DataType") int out_type, @Const @ByRef GraphDefBuilder.Options opts); // Transforms a vector of brain.Example protos (as strings) into typed tensors. // // Arguments: // * serialized: A vector containing a batch of binary serialized Example protos. // * names: A vector containing the names of the serialized protos. // May contain, for example, table key (descriptive) names for the // corresponding serialized protos. These are purely useful for debugging // purposes, and the presence of values here has no effect on the output. // May also be an empty vector if no names are available. // If non-empty, this vector must be the same length as "serialized". // * sparse_keys: A list of Nsparse string Tensors (scalars). // The keys expected in the Examples' features associated with sparse values. // * dense_keys: A list of Ndense string Tensors (scalars). // The keys expected in the Examples' features associated with dense values. // * dense_defaults: A list of Ndense Tensors (some may be empty). // dense_defaults[j] provides default values // when the example's feature_map lacks dense_key[j]. If an empty Tensor is // provided for dense_defaults[j], then the Feature dense_keys[j] is required. // The input type is inferred from dense_defaults[j], even when it's empty. // If dense_defaults[j] is not empty, its shape must match dense_shapes[j]. // * sparse_types: A list of Nsparse types; the data types of data in each Feature // given in sparse_keys. // Currently the ParseExample supports DT_FLOAT (FloatList), // DT_INT64 (Int64List), and DT_STRING (BytesList). // * dense_shapes: A list of Ndense shapes; the shapes of data in each Feature // given in dense_keys. // The number of elements in the Feature corresponding to dense_key[j] // must always equal dense_shapes[j].NumEntries(). // If dense_shapes[j] == (D0, D1, ..., DN) then the shape of output // Tensor dense_values[j] will be (|serialized|, D0, D1, ..., DN): // The dense outputs are just the inputs row-stacked by batch. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * sparse_indices // * sparse_values // * sparse_shapes // * dense_values @Namespace("tensorflow::ops") public static native Node ParseExample(@ByVal NodeBuilder.NodeOut serialized, @ByVal NodeBuilder.NodeOut names, @ByVal NodeOutVector sparse_keys, @ByVal NodeOutVector dense_keys, @ByVal NodeOutVector dense_defaults, @ByVal DataTypeVector sparse_types, @ByVal TensorShapeVector dense_shapes, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ParseExample(Node serialized, Node names, @ByVal NodeOutVector sparse_keys, @ByVal NodeOutVector dense_keys, @ByVal NodeOutVector dense_defaults, @ByVal DataTypeVector sparse_types, @ByVal TensorShapeVector dense_shapes, @Const @ByRef GraphDefBuilder.Options opts); // Transforms a scalar brain.SequenceExample proto (as strings) into typed tensors. // // Arguments: // * serialized: A scalar containing a binary serialized SequenceExample proto. // * feature_list_dense_missing_assumed_empty: A vector listing the // FeatureList keys which may be missing from the SequenceExample. If the // associated FeatureList is missing, it is treated as empty. By default, // any FeatureList not listed in this vector must exist in the SequenceExample. // * context_sparse_keys: A list of Ncontext_sparse string Tensors (scalars). // The keys expected in the Examples' features associated with context_sparse // values. // * context_dense_keys: A list of Ncontext_dense string Tensors (scalars). // The keys expected in the SequenceExamples' context features associated with // dense values. // * feature_list_sparse_keys: A list of Nfeature_list_sparse string Tensors // (scalars). The keys expected in the FeatureLists associated with sparse // values. // * feature_list_dense_keys: A list of Nfeature_list_dense string Tensors (scalars). // The keys expected in the SequenceExamples' feature_lists associated // with lists of dense values. // * context_dense_defaults: A list of Ncontext_dense Tensors (some may be empty). // context_dense_defaults[j] provides default values // when the SequenceExample's context map lacks context_dense_key[j]. // If an empty Tensor is provided for context_dense_defaults[j], // then the Feature context_dense_keys[j] is required. // The input type is inferred from context_dense_defaults[j], even when it's // empty. If context_dense_defaults[j] is not empty, its shape must match // context_dense_shapes[j]. // * debug_name: A scalar containing the name of the serialized proto. // May contain, for example, table key (descriptive) name for the // corresponding serialized proto. This is purely useful for debugging // purposes, and the presence of values here has no effect on the output. // May also be an empty scalar if no name is available. // * opts: // .WithAttr("context_sparse_types", DataTypeSlice): Defaults to []. // A list of Ncontext_sparse types; the data types of data in // each context Feature given in context_sparse_keys. // Currently the ParseSingleSequenceExample supports DT_FLOAT (FloatList), // DT_INT64 (Int64List), and DT_STRING (BytesList). // .WithAttr("feature_list_dense_types", DataTypeSlice): Defaults to []. // .WithAttr("context_dense_shapes", gtl::ArraySlice): Defaults to []. // A list of Ncontext_dense shapes; the shapes of data in // each context Feature given in context_dense_keys. // The number of elements in the Feature corresponding to context_dense_key[j] // must always equal context_dense_shapes[j].NumEntries(). // The shape of context_dense_values[j] will match context_dense_shapes[j]. // .WithAttr("feature_list_sparse_types", DataTypeSlice): Defaults to []. // A list of Nfeature_list_sparse types; the data types // of data in each FeatureList given in feature_list_sparse_keys. // Currently the ParseSingleSequenceExample supports DT_FLOAT (FloatList), // DT_INT64 (Int64List), and DT_STRING (BytesList). // .WithAttr("feature_list_dense_shapes", gtl::ArraySlice): Defaults to []. // A list of Nfeature_list_dense shapes; the shapes of // data in each FeatureList given in feature_list_dense_keys. // The shape of each Feature in the FeatureList corresponding to // feature_list_dense_key[j] must always equal // feature_list_dense_shapes[j].NumEntries(). // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * context_sparse_indices // * context_sparse_values // * context_sparse_shapes // * context_dense_values // * feature_list_sparse_indices // * feature_list_sparse_values // * feature_list_sparse_shapes // * feature_list_dense_values @Namespace("tensorflow::ops") public static native Node ParseSingleSequenceExample(@ByVal NodeBuilder.NodeOut serialized, @ByVal NodeBuilder.NodeOut feature_list_dense_missing_assumed_empty, @ByVal NodeOutVector context_sparse_keys, @ByVal NodeOutVector context_dense_keys, @ByVal NodeOutVector feature_list_sparse_keys, @ByVal NodeOutVector feature_list_dense_keys, @ByVal NodeOutVector context_dense_defaults, @ByVal NodeBuilder.NodeOut debug_name, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ParseSingleSequenceExample(Node serialized, Node feature_list_dense_missing_assumed_empty, @ByVal NodeOutVector context_sparse_keys, @ByVal NodeOutVector context_dense_keys, @ByVal NodeOutVector feature_list_sparse_keys, @ByVal NodeOutVector feature_list_dense_keys, @ByVal NodeOutVector context_dense_defaults, Node debug_name, @Const @ByRef GraphDefBuilder.Options opts); // Converts each string in the input Tensor to the specified numeric type. // // (Note that int32 overflow results in an error while float overflow // results in a rounded value.) // // Arguments: // * opts: // .WithAttr("out_type", DataType): Defaults to DT_FLOAT. // The numeric type to interpret each string in string_tensor as. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A Tensor of the same shape as the input `string_tensor`. @Namespace("tensorflow::ops") public static native Node StringToNumber(@ByVal NodeBuilder.NodeOut string_tensor, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node StringToNumber(Node string_tensor, @Const @ByRef GraphDefBuilder.Options opts); // namespace ops // namespace tensorflow // #endif // TENSORFLOW_CC_OPS_PARSING_OPS_H_ // Parsed from tensorflow/cc/ops/random_ops.h // This file is MACHINE GENERATED! Do not edit. // #ifndef TENSORFLOW_CC_OPS_RANDOM_OPS_H_ // #define TENSORFLOW_CC_OPS_RANDOM_OPS_H_ // #include "tensorflow/core/framework/tensor.h" // #include "tensorflow/core/framework/tensor_shape.h" // #include "tensorflow/core/framework/types.h" // #include "tensorflow/core/graph/graph_def_builder.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // These add a node to the graph from opts. // // Note for "NodeOut" inputs, you will typically either pass // * a {Node*, int index} (to pass the index-th output of that node), or // * a Node* (to pass the first output of that node). // Randomly shuffles a tensor along its first dimension. // // The tensor is shuffled along dimension 0, such that each `value[j]` is mapped // to one and only one `output[i]`. For example, a mapping that might occur for a // 3x2 tensor is: // // ```prettyprint // [[1, 2], [[5, 6], // [3, 4], ==> [1, 2], // [5, 6]] [3, 4]] // ``` // // Arguments: // * value: The tensor to be shuffled. // * opts: // .WithAttr("seed", int64): Defaults to 0. // If either `seed` or `seed2` are set to be non-zero, the random number // generator is seeded by the given seed. Otherwise, it is seeded by a // random seed. // .WithAttr("seed2", int64): Defaults to 0. // A second seed to avoid seed collision. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A tensor of same shape and type as `value`, shuffled along its first // dimension. @Namespace("tensorflow::ops") public static native Node RandomShuffle(@ByVal NodeBuilder.NodeOut value, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node RandomShuffle(Node value, @Const @ByRef GraphDefBuilder.Options opts); // Outputs random values from a normal distribution. // // The generated values will have mean 0 and standard deviation 1. // // Arguments: // * shape: The shape of the output tensor. // * dtype: The type of the output. // * opts: // .WithAttr("seed", int64): Defaults to 0. // If either `seed` or `seed2` are set to be non-zero, the random number // generator is seeded by the given seed. Otherwise, it is seeded by a // random seed. // .WithAttr("seed2", int64): Defaults to 0. // A second seed to avoid seed collision. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A tensor of the specified shape filled with random normal values. @Namespace("tensorflow::ops") public static native Node RandomStandardNormal(@ByVal NodeBuilder.NodeOut shape, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node RandomStandardNormal(Node shape, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); // Outputs random values from a uniform distribution. // // The generated values follow a uniform distribution in the range `[0, 1)`. The // lower bound 0 is included in the range, while the upper bound 1 is excluded. // // Arguments: // * shape: The shape of the output tensor. // * dtype: The type of the output. // * opts: // .WithAttr("seed", int64): Defaults to 0. // If either `seed` or `seed2` are set to be non-zero, the random number // generator is seeded by the given seed. Otherwise, it is seeded by a // random seed. // .WithAttr("seed2", int64): Defaults to 0. // A second seed to avoid seed collision. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A tensor of the specified shape filled with uniform random values. @Namespace("tensorflow::ops") public static native Node RandomUniform(@ByVal NodeBuilder.NodeOut shape, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node RandomUniform(Node shape, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); // Outputs random integers from a uniform distribution. // // The generated values are uniform integers in the range `[minval, maxval)`. // The lower bound `minval` is included in the range, while the upper bound // `maxval` is excluded. // // The random integers are slightly biased unless `maxval - minval` is an exact // power of two. The bias is small for values of `maxval - minval` significantly // smaller than the range of the output (either `2^32` or `2^64`). // // Arguments: // * shape: The shape of the output tensor. // * minval: 0-D. Inclusive lower bound on the generated integers. // * maxval: 0-D. Exclusive upper bound on the generated integers. // * opts: // .WithAttr("seed", int64): Defaults to 0. // If either `seed` or `seed2` are set to be non-zero, the random number // generator is seeded by the given seed. Otherwise, it is seeded by a // random seed. // .WithAttr("seed2", int64): Defaults to 0. // A second seed to avoid seed collision. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A tensor of the specified shape filled with uniform random integers. @Namespace("tensorflow::ops") public static native Node RandomUniformInt(@ByVal NodeBuilder.NodeOut shape, @ByVal NodeBuilder.NodeOut minval, @ByVal NodeBuilder.NodeOut maxval, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node RandomUniformInt(Node shape, Node minval, Node maxval, @Const @ByRef GraphDefBuilder.Options opts); // Outputs random values from a truncated normal distribution. // // The generated values follow a normal distribution with mean 0 and standard // deviation 1, except that values whose magnitude is more than 2 standard // deviations from the mean are dropped and re-picked. // // Arguments: // * shape: The shape of the output tensor. // * dtype: The type of the output. // * opts: // .WithAttr("seed", int64): Defaults to 0. // If either `seed` or `seed2` are set to be non-zero, the random number // generator is seeded by the given seed. Otherwise, it is seeded by a // random seed. // .WithAttr("seed2", int64): Defaults to 0. // A second seed to avoid seed collision. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A tensor of the specified shape filled with random truncated normal // values. @Namespace("tensorflow::ops") public static native Node TruncatedNormal(@ByVal NodeBuilder.NodeOut shape, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node TruncatedNormal(Node shape, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); // namespace ops // namespace tensorflow // #endif // TENSORFLOW_CC_OPS_RANDOM_OPS_H_ // Parsed from tensorflow/cc/ops/sparse_ops.h // This file is MACHINE GENERATED! Do not edit. // #ifndef TENSORFLOW_CC_OPS_SPARSE_OPS_H_ // #define TENSORFLOW_CC_OPS_SPARSE_OPS_H_ // #include "tensorflow/core/framework/tensor.h" // #include "tensorflow/core/framework/tensor_shape.h" // #include "tensorflow/core/framework/types.h" // #include "tensorflow/core/graph/graph_def_builder.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // These add a node to the graph from opts. // // Note for "NodeOut" inputs, you will typically either pass // * a {Node*, int index} (to pass the index-th output of that node), or // * a Node* (to pass the first output of that node). // Deserialize and concatenate `SparseTensors` from a serialized minibatch. // // The input `serialized_sparse` must be a string matrix of shape `[N x 3]` where // `N` is the minibatch size and the rows correspond to packed outputs of // `SerializeSparse`. The ranks of the original `SparseTensor` objects // must all match. When the final `SparseTensor` is created, it has rank one // higher than the ranks of the incoming `SparseTensor` objects // (they have been concatenated along a new row dimension). // // The output `SparseTensor` object's shape values for all dimensions but the // first are the max across the input `SparseTensor` objects' shape values // for the corresponding dimensions. Its first shape value is `N`, the minibatch // size. // // The input `SparseTensor` objects' indices are assumed ordered in // standard lexicographic order. If this is not the case, after this // step run `SparseReorder` to restore index ordering. // // For example, if the serialized input is a `[2 x 3]` matrix representing two // original `SparseTensor` objects: // // index = [ 0] // [10] // [20] // values = [1, 2, 3] // shape = [50] // // and // // index = [ 2] // [10] // values = [4, 5] // shape = [30] // // then the final deserialized `SparseTensor` will be: // // index = [0 0] // [0 10] // [0 20] // [1 2] // [1 10] // values = [1, 2, 3, 4, 5] // shape = [2 50] // // Arguments: // * serialized_sparse: 2-D, The `N` serialized `SparseTensor` objects. // Must have 3 columns. // * dtype: The `dtype` of the serialized `SparseTensor` objects. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * sparse_indices // * sparse_values // * sparse_shape @Namespace("tensorflow::ops") public static native Node DeserializeManySparse(@ByVal NodeBuilder.NodeOut serialized_sparse, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DeserializeManySparse(Node serialized_sparse, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); // Serialize an `N`-minibatch `SparseTensor` into an `[N, 3]` string `Tensor`. // // The `SparseTensor` must have rank `R` greater than 1, and the first dimension // is treated as the minibatch dimension. Elements of the `SparseTensor` // must be sorted in increasing order of this first dimension. The serialized // `SparseTensor` objects going into each row of `serialized_sparse` will have // rank `R-1`. // // The minibatch size `N` is extracted from `sparse_shape[0]`. // // Arguments: // * sparse_indices: 2-D. The `indices` of the minibatch `SparseTensor`. // * sparse_values: 1-D. The `values` of the minibatch `SparseTensor`. // * sparse_shape: 1-D. The `shape` of the minibatch `SparseTensor`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node SerializeManySparse(@ByVal NodeBuilder.NodeOut sparse_indices, @ByVal NodeBuilder.NodeOut sparse_values, @ByVal NodeBuilder.NodeOut sparse_shape, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SerializeManySparse(Node sparse_indices, Node sparse_values, Node sparse_shape, @Const @ByRef GraphDefBuilder.Options opts); // Serialize a `SparseTensor` into a string 3-vector (1-D `Tensor`) object. // // Arguments: // * sparse_indices: 2-D. The `indices` of the `SparseTensor`. // * sparse_values: 1-D. The `values` of the `SparseTensor`. // * sparse_shape: 1-D. The `shape` of the `SparseTensor`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node SerializeSparse(@ByVal NodeBuilder.NodeOut sparse_indices, @ByVal NodeBuilder.NodeOut sparse_values, @ByVal NodeBuilder.NodeOut sparse_shape, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SerializeSparse(Node sparse_indices, Node sparse_values, Node sparse_shape, @Const @ByRef GraphDefBuilder.Options opts); // Adds two `SparseTensor` objects to produce another `SparseTensor`. // // The input `SparseTensor` objects' indices are assumed ordered in standard // lexicographic order. If this is not the case, before this step run // `SparseReorder` to restore index ordering. // // By default, if two values sum to zero at some index, the output `SparseTensor` // would still include that particular location in its index, storing a zero in the // corresponding value slot. To override this, callers can specify `thresh`, // indicating that if the sum has a magnitude strictly smaller than `thresh`, its // corresponding value and index would then not be included. In particular, // `thresh == 0` (default) means everything is kept and actual thresholding happens // only for a positive value. // // In the following shapes, `nnz` is the count after taking `thresh` into account. // // Arguments: // * a_indices: 2-D. The `indices` of the first `SparseTensor`, size `[nnz, ndims]` Matrix. // * a_values: 1-D. The `values` of the first `SparseTensor`, size `[nnz]` Vector. // * a_shape: 1-D. The `shape` of the first `SparseTensor`, size `[ndims]` Vector. // * b_indices: 2-D. The `indices` of the second `SparseTensor`, size `[nnz, ndims]` Matrix. // * b_values: 1-D. The `values` of the second `SparseTensor`, size `[nnz]` Vector. // * b_shape: 1-D. The `shape` of the second `SparseTensor`, size `[ndims]` Vector. // * thresh: 0-D. The magnitude threshold that determines if an output value/index // pair takes space. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * sum_indices // * sum_values // * sum_shape @Namespace("tensorflow::ops") public static native Node SparseAdd(@ByVal NodeBuilder.NodeOut a_indices, @ByVal NodeBuilder.NodeOut a_values, @ByVal NodeBuilder.NodeOut a_shape, @ByVal NodeBuilder.NodeOut b_indices, @ByVal NodeBuilder.NodeOut b_values, @ByVal NodeBuilder.NodeOut b_shape, @ByVal NodeBuilder.NodeOut thresh, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SparseAdd(Node a_indices, Node a_values, Node a_shape, Node b_indices, Node b_values, Node b_shape, Node thresh, @Const @ByRef GraphDefBuilder.Options opts); // The gradient operator for the SparseAdd op. // // The SparseAdd op calculates A + B, where A, B, and the sum are all represented // as `SparseTensor` objects. This op takes in the upstream gradient w.r.t. // non-empty values of the sum, and outputs the gradients w.r.t. the non-empty // values of A and B. // // Arguments: // * backprop_val_grad: 1-D with shape `[nnz(sum)]`. The gradient with respect to // the non-empty values of the sum. // * a_indices: 2-D. The `indices` of the `SparseTensor` A, size `[nnz(A), ndims]`. // * b_indices: 2-D. The `indices` of the `SparseTensor` B, size `[nnz(B), ndims]`. // * sum_indices: 2-D. The `indices` of the sum `SparseTensor`, size // `[nnz(sum), ndims]`. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * a_val_grad: 1-D with shape `[nnz(A)]`. The gradient with respect to the // non-empty values of A. // * b_val_grad: 1-D with shape `[nnz(B)]`. The gradient with respect to the // non-empty values of B. @Namespace("tensorflow::ops") public static native Node SparseAddGrad(@ByVal NodeBuilder.NodeOut backprop_val_grad, @ByVal NodeBuilder.NodeOut a_indices, @ByVal NodeBuilder.NodeOut b_indices, @ByVal NodeBuilder.NodeOut sum_indices, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SparseAddGrad(Node backprop_val_grad, Node a_indices, Node b_indices, Node sum_indices, @Const @ByRef GraphDefBuilder.Options opts); // Concatenates a list of `SparseTensor` along the specified dimension. // // Concatenation is with respect to the dense versions of these sparse tensors. // It is assumed that each input is a `SparseTensor` whose elements are ordered // along increasing dimension number. // // All inputs' shapes must match, except for the concat dimension. The // `indices`, `values`, and `shapes` lists must have the same length. // // The output shape is identical to the inputs', except along the concat // dimension, where it is the sum of the inputs' sizes along that dimension. // // The output elements will be resorted to preserve the sort order along // increasing dimension number. // // This op runs in `O(M log M)` time, where `M` is the total number of non-empty // values across all inputs. This is due to the need for an internal sort in // order to concatenate efficiently across an arbitrary dimension. // // For example, if `concat_dim = 1` and the inputs are // // sp_inputs[0]: shape = [2, 3] // [0, 2]: "a" // [1, 0]: "b" // [1, 1]: "c" // // sp_inputs[1]: shape = [2, 4] // [0, 1]: "d" // [0, 2]: "e" // // then the output will be // // shape = [2, 7] // [0, 2]: "a" // [0, 4]: "d" // [0, 5]: "e" // [1, 0]: "b" // [1, 1]: "c" // // Graphically this is equivalent to doing // // [ a] concat [ d e ] = [ a d e ] // [b c ] [ ] [b c ] // // Arguments: // * indices: 2-D. Indices of each input `SparseTensor`. // * values: 1-D. Non-empty values of each `SparseTensor`. // * shapes: 1-D. Shapes of each `SparseTensor`. // * concat_dim: Dimension to concatenate along. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * output_indices: 2-D. Indices of the concatenated `SparseTensor`. // * output_values: 1-D. Non-empty values of the concatenated `SparseTensor`. // * output_shape: 1-D. Shape of the concatenated `SparseTensor`. @Namespace("tensorflow::ops") public static native Node SparseConcat(@ByVal NodeOutVector indices, @ByVal NodeOutVector values, @ByVal NodeOutVector shapes, @Cast("tensorflow::int64") long concat_dim, @Const @ByRef GraphDefBuilder.Options opts); // Reorders a SparseTensor into the canonical, row-major ordering. // // Note that by convention, all sparse ops preserve the canonical ordering along // increasing dimension number. The only time ordering can be violated is during // manual manipulation of the indices and values vectors to add entries. // // Reordering does not affect the shape of the SparseTensor. // // If the tensor has rank `R` and `N` non-empty values, `input_indices` has // shape `[N, R]`, input_values has length `N`, and input_shape has length `R`. // // Arguments: // * input_indices: 2-D. `N x R` matrix with the indices of non-empty values in a // SparseTensor, possibly not in canonical ordering. // * input_values: 1-D. `N` non-empty values corresponding to `input_indices`. // * input_shape: 1-D. Shape of the input SparseTensor. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * output_indices: 2-D. `N x R` matrix with the same indices as input_indices, but // in canonical row-major ordering. // * output_values: 1-D. `N` non-empty values corresponding to `output_indices`. @Namespace("tensorflow::ops") public static native Node SparseReorder(@ByVal NodeBuilder.NodeOut input_indices, @ByVal NodeBuilder.NodeOut input_values, @ByVal NodeBuilder.NodeOut input_shape, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SparseReorder(Node input_indices, Node input_values, Node input_shape, @Const @ByRef GraphDefBuilder.Options opts); // Split a `SparseTensor` into `num_split` tensors along one dimension. // // If the `shape[split_dim]` is not an integer multiple of `num_split`. Slices // `[0 : shape[split_dim] % num_split]` gets one extra dimension. // For example, if `split_dim = 1` and `num_split = 2` and the input is // // input_tensor = shape = [2, 7] // [ a d e ] // [b c ] // // Graphically the output tensors are: // // output_tensor[0] = shape = [2, 4] // [ a ] // [b c ] // // output_tensor[1] = shape = [2, 3] // [ d e ] // [ ] // // Arguments: // * split_dim: 0-D. The dimension along which to split. Must be in the range // `[0, rank(shape))`. // * indices: 2-D tensor represents the indices of the sparse tensor. // * values: 1-D tensor represents the values of the sparse tensor. // * shape: 1-D. tensor represents the shape of the sparse tensor. // output indices: A list of 1-D tensors represents the indices of the output // sparse tensors. // * num_split: The number of ways to split. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with outputs: // * output_indices // * output_values: A list of 1-D tensors represents the values of the output sparse // tensors. // * output_shape: A list of 1-D tensors represents the shape of the output sparse // tensors. @Namespace("tensorflow::ops") public static native Node SparseSplit(@ByVal NodeBuilder.NodeOut split_dim, @ByVal NodeBuilder.NodeOut indices, @ByVal NodeBuilder.NodeOut values, @ByVal NodeBuilder.NodeOut shape, @Cast("tensorflow::int64") long num_split, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SparseSplit(Node split_dim, Node indices, Node values, Node shape, @Cast("tensorflow::int64") long num_split, @Const @ByRef GraphDefBuilder.Options opts); // Multiply SparseTensor (of rank 2) "A" by dense matrix "B". // // No validity checking is performed on the indices of A. However, the following // input format is recommended for optimal behavior: // // if adjoint_a == false: // A should be sorted in lexicographically increasing order. Use SparseReorder // if you're not sure. // if adjoint_a == true: // A should be sorted in order of increasing dimension 1 (i.e., "column major" // order instead of "row major" order). // // Arguments: // * a_indices: 2-D. The `indices` of the `SparseTensor`, size `[nnz, 2]` Matrix. // * a_values: 1-D. The `values` of the `SparseTensor`, size `[nnz]` Vector. // * a_shape: 1-D. The `shape` of the `SparseTensor`, size `[2]` Vector. // * b: 2-D. A dense Matrix. // * opts: // .WithAttr("adjoint_a", bool): Defaults to false. // Use the adjoint of A in the matrix multiply. If A is complex, this // is transpose(conj(A)). Otherwise it's transpose(A). // .WithAttr("adjoint_b", bool): Defaults to false. // Use the adjoint of B in the matrix multiply. If B is complex, this // is transpose(conj(B)). Otherwise it's transpose(B). // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node SparseTensorDenseMatMul(@ByVal NodeBuilder.NodeOut a_indices, @ByVal NodeBuilder.NodeOut a_values, @ByVal NodeBuilder.NodeOut a_shape, @ByVal NodeBuilder.NodeOut b, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SparseTensorDenseMatMul(Node a_indices, Node a_values, Node a_shape, Node b, @Const @ByRef GraphDefBuilder.Options opts); // Converts a sparse representation into a dense tensor. // // Builds an array `dense` with shape `output_shape` such that // // ```prettyprint // # If sparse_indices is scalar // dense[i] = (i == sparse_indices ? sparse_values : default_value) // // # If sparse_indices is a vector, then for each i // dense[sparse_indices[i]] = sparse_values[i] // // # If sparse_indices is an n by d matrix, then for each i in [0, n) // dense[sparse_indices[i][0], ..., sparse_indices[i][d-1]] = sparse_values[i] // ``` // // All other values in `dense` are set to `default_value`. If `sparse_values` is a // scalar, all sparse indices are set to this single value. // // Indices should be sorted in lexicographic order, and indices must not // contain any repeats. If `validate_indices` is true, these properties // are checked during execution. // // Arguments: // * sparse_indices: 0-D, 1-D, or 2-D. `sparse_indices[i]` contains the complete // index where `sparse_values[i]` will be placed. // * output_shape: 1-D. Shape of the dense output tensor. // * sparse_values: 1-D. Values corresponding to each row of `sparse_indices`, // or a scalar value to be used for all sparse indices. // * default_value: Scalar value to set for indices not specified in // `sparse_indices`. // * opts: // .WithAttr("validate_indices", bool): Defaults to true. // If true, indices are checked to make sure they are sorted in // lexicographic order and that there are no repeats. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Dense output tensor of shape `output_shape`. @Namespace("tensorflow::ops") public static native Node SparseToDense(@ByVal NodeBuilder.NodeOut sparse_indices, @ByVal NodeBuilder.NodeOut output_shape, @ByVal NodeBuilder.NodeOut sparse_values, @ByVal NodeBuilder.NodeOut default_value, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SparseToDense(Node sparse_indices, Node output_shape, Node sparse_values, Node default_value, @Const @ByRef GraphDefBuilder.Options opts); // namespace ops // namespace tensorflow // #endif // TENSORFLOW_CC_OPS_SPARSE_OPS_H_ // Parsed from tensorflow/cc/ops/state_ops.h // This file is MACHINE GENERATED! Do not edit. // #ifndef TENSORFLOW_CC_OPS_STATE_OPS_H_ // #define TENSORFLOW_CC_OPS_STATE_OPS_H_ // #include "tensorflow/core/framework/tensor.h" // #include "tensorflow/core/framework/tensor_shape.h" // #include "tensorflow/core/framework/types.h" // #include "tensorflow/core/graph/graph_def_builder.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // These add a node to the graph from opts. // // Note for "NodeOut" inputs, you will typically either pass // * a {Node*, int index} (to pass the index-th output of that node), or // * a Node* (to pass the first output of that node). // Update 'ref' by assigning 'value' to it. // // This operation outputs "ref" after the assignment is done. // This makes it easier to chain operations that need to use the reset value. // // Arguments: // * ref: Should be from a `Variable` node. May be uninitialized. // * value: The value to be assigned to the variable. // * opts: // .WithAttr("validate_shape", bool): Defaults to true. // If true, the operation will validate that the shape // of 'value' matches the shape of the Tensor being assigned to. If false, // 'ref' will take on the shape of 'value'. // .WithAttr("use_locking", bool): Defaults to true. // If True, the assignment will be protected by a lock; // otherwise the behavior is undefined, but may exhibit less contention. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Same as "ref". Returned as a convenience for operations that want // to use the new value after the variable has been reset. @Namespace("tensorflow::ops") public static native Node Assign(@ByVal NodeBuilder.NodeOut ref, @ByVal NodeBuilder.NodeOut value, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node Assign(Node ref, Node value, @Const @ByRef GraphDefBuilder.Options opts); // Update 'ref' by adding 'value' to it. // // This operation outputs "ref" after the update is done. // This makes it easier to chain operations that need to use the reset value. // // Arguments: // * ref: Should be from a `Variable` node. // * value: The value to be added to the variable. // * opts: // .WithAttr("use_locking", bool): Defaults to false. // If True, the addition will be protected by a lock; // otherwise the behavior is undefined, but may exhibit less contention. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Same as "ref". Returned as a convenience for operations that want // to use the new value after the variable has been updated. @Namespace("tensorflow::ops") public static native Node AssignAdd(@ByVal NodeBuilder.NodeOut ref, @ByVal NodeBuilder.NodeOut value, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node AssignAdd(Node ref, Node value, @Const @ByRef GraphDefBuilder.Options opts); // Update 'ref' by subtracting 'value' from it. // // This operation outputs "ref" after the update is done. // This makes it easier to chain operations that need to use the reset value. // // Arguments: // * ref: Should be from a `Variable` node. // * value: The value to be subtracted to the variable. // * opts: // .WithAttr("use_locking", bool): Defaults to false. // If True, the subtraction will be protected by a lock; // otherwise the behavior is undefined, but may exhibit less contention. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Same as "ref". Returned as a convenience for operations that want // to use the new value after the variable has been updated. @Namespace("tensorflow::ops") public static native Node AssignSub(@ByVal NodeBuilder.NodeOut ref, @ByVal NodeBuilder.NodeOut value, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node AssignSub(Node ref, Node value, @Const @ByRef GraphDefBuilder.Options opts); // Increments 'ref' until it reaches 'limit'. // // This operation outputs "ref" after the update is done. This makes it // easier to chain operations that need to use the updated value. // // Arguments: // * ref: Should be from a scalar `Variable` node. // * limit: If incrementing ref would bring it above limit, instead generates an // 'OutOfRange' error. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A copy of the input before increment. If nothing else modifies the // input, the values produced will all be distinct. @Namespace("tensorflow::ops") public static native Node CountUpTo(@ByVal NodeBuilder.NodeOut ref, @Cast("tensorflow::int64") long limit, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node CountUpTo(Node ref, @Cast("tensorflow::int64") long limit, @Const @ByRef GraphDefBuilder.Options opts); // Destroys the temporary variable and returns its final value. // // Sets output to the value of the Tensor pointed to by 'ref', then destroys // the temporary variable called 'var_name'. // All other uses of 'ref' *must* have executed before this op. // This is typically achieved by chaining the ref through each assign op, or by // using control dependencies. // // Outputs the final value of the tensor pointed to by 'ref'. // // Arguments: // * ref: A reference to the temporary variable tensor. // * var_name: Name of the temporary variable, usually the name of the matching // 'TemporaryVariable' op. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node DestroyTemporaryVariable(@ByVal NodeBuilder.NodeOut ref, @StringPiece BytePointer var_name, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node DestroyTemporaryVariable(Node ref, @StringPiece String var_name, @Const @ByRef GraphDefBuilder.Options opts); // Checks whether a tensor has been initialized. // // Outputs boolean scalar indicating whether the tensor has been initialized. // // Arguments: // * ref: Should be from a `Variable` node. May be uninitialized. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node IsVariableInitialized(@ByVal NodeBuilder.NodeOut ref, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node IsVariableInitialized(Node ref, @Const @ByRef GraphDefBuilder.Options opts); // Adds sparse updates to a variable reference. // // This operation computes // // # Scalar indices // ref[indices, ...] += updates[...] // // # Vector indices (for each i) // ref[indices[i], ...] += updates[i, ...] // // # High rank indices (for each i, ..., j) // ref[indices[i, ..., j], ...] += updates[i, ..., j, ...] // // This operation outputs `ref` after the update is done. // This makes it easier to chain operations that need to use the reset value. // // Duplicate entries are handled correctly: if multiple `indices` reference // the same location, their contributions add. // // Requires `updates.shape = indices.shape + ref.shape[1:]`. // //
// //
// // Arguments: // * ref: Should be from a `Variable` node. // * indices: A tensor of indices into the first dimension of `ref`. // * updates: A tensor of updated values to add to `ref`. // * opts: // .WithAttr("use_locking", bool): Defaults to false. // If True, the addition will be protected by a lock; // otherwise the behavior is undefined, but may exhibit less contention. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Same as `ref`. Returned as a convenience for operations that want // to use the updated values after the update is done. @Namespace("tensorflow::ops") public static native Node ScatterAdd(@ByVal NodeBuilder.NodeOut ref, @ByVal NodeBuilder.NodeOut indices, @ByVal NodeBuilder.NodeOut updates, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ScatterAdd(Node ref, Node indices, Node updates, @Const @ByRef GraphDefBuilder.Options opts); // Subtracts sparse updates to a variable reference. // // # Scalar indices // ref[indices, ...] -= updates[...] // // # Vector indices (for each i) // ref[indices[i], ...] -= updates[i, ...] // // # High rank indices (for each i, ..., j) // ref[indices[i, ..., j], ...] -= updates[i, ..., j, ...] // // This operation outputs `ref` after the update is done. // This makes it easier to chain operations that need to use the reset value. // // Duplicate entries are handled correctly: if multiple `indices` reference // the same location, their (negated) contributions add. // // Requires `updates.shape = indices.shape + ref.shape[1:]`. // //
// //
// // Arguments: // * ref: Should be from a `Variable` node. // * indices: A tensor of indices into the first dimension of `ref`. // * updates: A tensor of updated values to subtract from `ref`. // * opts: // .WithAttr("use_locking", bool): Defaults to false. // If True, the subtraction will be protected by a lock; // otherwise the behavior is undefined, but may exhibit less contention. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Same as `ref`. Returned as a convenience for operations that want // to use the updated values after the update is done. @Namespace("tensorflow::ops") public static native Node ScatterSub(@ByVal NodeBuilder.NodeOut ref, @ByVal NodeBuilder.NodeOut indices, @ByVal NodeBuilder.NodeOut updates, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ScatterSub(Node ref, Node indices, Node updates, @Const @ByRef GraphDefBuilder.Options opts); // Applies sparse updates to a variable reference. // // This operation computes // // # Scalar indices // ref[indices, ...] = updates[...] // // # Vector indices (for each i) // ref[indices[i], ...] = updates[i, ...] // // # High rank indices (for each i, ..., j) // ref[indices[i, ..., j], ...] = updates[i, ..., j, ...] // // This operation outputs `ref` after the update is done. // This makes it easier to chain operations that need to use the reset value. // // If values in `ref` is to be updated more than once, because there are // duplicate entires in `indices`, the order at which the updates happen // for each value is undefined. // // Requires `updates.shape = indices.shape + ref.shape[1:]`. // //
// //
// // Arguments: // * ref: Should be from a `Variable` node. // * indices: A tensor of indices into the first dimension of `ref`. // * updates: A tensor of updated values to store in `ref`. // * opts: // .WithAttr("use_locking", bool): Defaults to true. // If True, the assignment will be protected by a lock; // otherwise the behavior is undefined, but may exhibit less contention. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Same as `ref`. Returned as a convenience for operations that want // to use the updated values after the update is done. @Namespace("tensorflow::ops") public static native Node ScatterUpdate(@ByVal NodeBuilder.NodeOut ref, @ByVal NodeBuilder.NodeOut indices, @ByVal NodeBuilder.NodeOut updates, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ScatterUpdate(Node ref, Node indices, Node updates, @Const @ByRef GraphDefBuilder.Options opts); // Returns a tensor that may be mutated, but only persists within a single step. // // This is an experimental op for internal use only and it is possible to use this // op in unsafe ways. DO NOT USE unless you fully understand the risks. // // It is the caller's responsibility to ensure that 'ref' is eventually passed to a // matching 'DestroyTemporaryVariable' op after all other uses have completed. // // Outputs a ref to the tensor state so it may be read or modified. // // E.g. // var = state_ops._temporary_variable([1, 2], types.float_) // var_name = var.op.name // var = state_ops.assign(var, [[4.0, 5.0]]) // var = state_ops.assign_add(var, [[6.0, 7.0]]) // final = state_ops._destroy_temporary_variable(var, var_name=var_name) // // Arguments: // * shape: The shape of the variable tensor. // * dtype: The type of elements in the variable tensor. // * opts: // .WithAttr("var_name", StringPiece): Defaults to "". // Overrides the name used for the temporary variable resource. Default // value is the name of the 'TemporaryVariable' op (which is guaranteed unique). // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A reference to the variable tensor. @Namespace("tensorflow::ops") public static native Node TemporaryVariable(@ByVal TensorShape shape, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); // Holds state in the form of a tensor that persists across steps. // // Outputs a ref to the tensor state so it may be read or modified. // TODO(zhifengc/mrry): Adds a pointer to a more detail document // about sharing states in tensorflow. // // Arguments: // * shape: The shape of the variable tensor. // * dtype: The type of elements in the variable tensor. // * opts: // .WithAttr("container", StringPiece): Defaults to "". // If non-empty, this variable is placed in the given container. // Otherwise, a default container is used. // .WithAttr("shared_name", StringPiece): Defaults to "". // If non-empty, this variable is named in the given bucket // with this shared_name. Otherwise, the node name is used instead. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A reference to the variable tensor. @Namespace("tensorflow::ops") public static native Node Variable(@ByVal TensorShape shape, @Cast("tensorflow::DataType") int dtype, @Const @ByRef GraphDefBuilder.Options opts); // namespace ops // namespace tensorflow // #endif // TENSORFLOW_CC_OPS_STATE_OPS_H_ // Parsed from tensorflow/cc/ops/string_ops.h // This file is MACHINE GENERATED! Do not edit. // #ifndef TENSORFLOW_CC_OPS_STRING_OPS_H_ // #define TENSORFLOW_CC_OPS_STRING_OPS_H_ // #include "tensorflow/core/framework/tensor.h" // #include "tensorflow/core/framework/tensor_shape.h" // #include "tensorflow/core/framework/types.h" // #include "tensorflow/core/graph/graph_def_builder.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // These add a node to the graph from opts. // // Note for "NodeOut" inputs, you will typically either pass // * a {Node*, int index} (to pass the index-th output of that node), or // * a Node* (to pass the first output of that node). // Joins a string Tensor across the given dimensions. // // Computes the string join across dimensions in the given string Tensor of shape // `[d_0, d_1, ..., d_n-1]`. Returns a new Tensor created by joining the input // strings with the given separator (default: empty string). Negative indices are // counted backwards from the end, with `-1` being equivalent to `n - 1`. Passing // an empty `reduction_indices` joins all strings in linear index order and outputs // a scalar string. // // // For example: // ``` // # tensor `a` is [["a", "b"], ["c", "d"]] // tf.reduce_join(a, 0) ==> ["ac", "bd"] // tf.reduce_join(a, 1) ==> ["ab", "cd"] // tf.reduce_join(a, -2) = tf.reduce_join(a, 0) ==> ["ac", "bd"] // tf.reduce_join(a, -1) = tf.reduce_join(a, 1) ==> ["ab", "cd"] // tf.reduce_join(a, 0, keep_dims=True) ==> [["ac", "bd"]] // tf.reduce_join(a, 1, keep_dims=True) ==> [["ab"], ["cd"]] // tf.reduce_join(a, 0, separator=".") ==> ["a.c", "b.d"] // tf.reduce_join(a, [0, 1]) ==> ["acbd"] // tf.reduce_join(a, [1, 0]) ==> ["abcd"] // tf.reduce_join(a, []) ==> ["abcd"] // ``` // // Arguments: // * inputs: The input to be joined. All reduced indices must have non-zero size. // * reduction_indices: The dimensions to reduce over. Dimensions are reduced in the // order specified. If `reduction_indices` has higher rank than `1`, it is // flattened. Omitting `reduction_indices` is equivalent to passing // `[n-1, n-2, ..., 0]`. Negative indices from `-n` to `-1` are supported. // * opts: // .WithAttr("keep_dims", bool): Defaults to false. // If `True`, retain reduced dimensions with length `1`. // .WithAttr("separator", StringPiece): Defaults to "". // The separator to use when joining. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Has shape equal to that of the input with reduced dimensions removed or // set to `1` depending on `keep_dims`. @Namespace("tensorflow::ops") public static native Node ReduceJoin(@ByVal NodeBuilder.NodeOut inputs, @ByVal NodeBuilder.NodeOut reduction_indices, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ReduceJoin(Node inputs, Node reduction_indices, @Const @ByRef GraphDefBuilder.Options opts); // Converts each string in the input Tensor to its hash mod by a number of buckets. // // The hash function is deterministic on the content of the string within the // process. // // Note that the hash function may change from time to time. // // Arguments: // * num_buckets: The number of buckets. // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // A Tensor of the same shape as the input `string_tensor`. @Namespace("tensorflow::ops") public static native Node StringToHashBucket(@ByVal NodeBuilder.NodeOut string_tensor, @Cast("tensorflow::int64") long num_buckets, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node StringToHashBucket(Node string_tensor, @Cast("tensorflow::int64") long num_buckets, @Const @ByRef GraphDefBuilder.Options opts); // namespace ops // namespace tensorflow // #endif // TENSORFLOW_CC_OPS_STRING_OPS_H_ // Parsed from tensorflow/cc/ops/training_ops.h // This file is MACHINE GENERATED! Do not edit. // #ifndef TENSORFLOW_CC_OPS_TRAINING_OPS_H_ // #define TENSORFLOW_CC_OPS_TRAINING_OPS_H_ // #include "tensorflow/core/framework/tensor.h" // #include "tensorflow/core/framework/tensor_shape.h" // #include "tensorflow/core/framework/types.h" // #include "tensorflow/core/graph/graph_def_builder.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // These add a node to the graph from opts. // // Note for "NodeOut" inputs, you will typically either pass // * a {Node*, int index} (to pass the index-th output of that node), or // * a Node* (to pass the first output of that node). // Update '*var' according to the adadelta scheme. // // accum = rho() * accum + (1 - rho()) * grad.square(); // update = (update_accum + epsilon).sqrt() * (accum + epsilon()).rsqrt() * grad; // update_accum = rho() * update_accum + (1 - rho()) * update.square(); // var -= update; // // Arguments: // * var: Should be from a Variable(). // * accum: Should be from a Variable(). // * accum_update: Should be from a Variable(). // * lr: Scaling factor. Must be a scalar. // * rho: Decay factor. Must be a scalar. // * epsilon: Constant factor. Must be a scalar. // * grad: The gradient. // * opts: // .WithAttr("use_locking", bool): Defaults to false. // If True, updating of the var, accum and update_accum tensors will be protected by // a lock; otherwise the behavior is undefined, but may exhibit less contention. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Same as "var". @Namespace("tensorflow::ops") public static native Node ApplyAdadelta(@ByVal NodeBuilder.NodeOut var, @ByVal NodeBuilder.NodeOut accum, @ByVal NodeBuilder.NodeOut accum_update, @ByVal NodeBuilder.NodeOut lr, @ByVal NodeBuilder.NodeOut rho, @ByVal NodeBuilder.NodeOut epsilon, @ByVal NodeBuilder.NodeOut grad, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ApplyAdadelta(Node var, Node accum, Node accum_update, Node lr, Node rho, Node epsilon, Node grad, @Const @ByRef GraphDefBuilder.Options opts); // Update '*var' according to the adagrad scheme. // // accum += grad * grad // var -= lr * grad * (1 / sqrt(accum)) // // Arguments: // * var: Should be from a Variable(). // * accum: Should be from a Variable(). // * lr: Scaling factor. Must be a scalar. // * grad: The gradient. // * opts: // .WithAttr("use_locking", bool): Defaults to false. // If `True`, updating of the var and accum tensors will be protected // by a lock; otherwise the behavior is undefined, but may exhibit less // contention. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Same as "var". @Namespace("tensorflow::ops") public static native Node ApplyAdagrad(@ByVal NodeBuilder.NodeOut var, @ByVal NodeBuilder.NodeOut accum, @ByVal NodeBuilder.NodeOut lr, @ByVal NodeBuilder.NodeOut grad, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ApplyAdagrad(Node var, Node accum, Node lr, Node grad, @Const @ByRef GraphDefBuilder.Options opts); // Update '*var' according to the Adam algorithm. // // lr_t <- learning_rate * sqrt(1 - beta2^t) / (1 - beta1^t) // m_t <- beta1 * m_{t-1} + (1 - beta1) * g_t // v_t <- beta2 * v_{t-1} + (1 - beta2) * g_t * g_t // variable <- variable - lr_t * m_t / (sqrt(v_t) + epsilon) // // Arguments: // * var: Should be from a Variable(). // * m: Should be from a Variable(). // * v: Should be from a Variable(). // * beta1_power: Must be a scalar. // * beta2_power: Must be a scalar. // * lr: Scaling factor. Must be a scalar. // * beta1: Momentum factor. Must be a scalar. // * beta2: Momentum factor. Must be a scalar. // * epsilon: Ridge term. Must be a scalar. // * grad: The gradient. // * opts: // .WithAttr("use_locking", bool): Defaults to false. // If `True`, updating of the var, m, and v tensors will be protected // by a lock; otherwise the behavior is undefined, but may exhibit less // contention. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Same as "var". @Namespace("tensorflow::ops") public static native Node ApplyAdam(@ByVal NodeBuilder.NodeOut var, @ByVal NodeBuilder.NodeOut m, @ByVal NodeBuilder.NodeOut v, @ByVal NodeBuilder.NodeOut beta1_power, @ByVal NodeBuilder.NodeOut beta2_power, @ByVal NodeBuilder.NodeOut lr, @ByVal NodeBuilder.NodeOut beta1, @ByVal NodeBuilder.NodeOut beta2, @ByVal NodeBuilder.NodeOut epsilon, @ByVal NodeBuilder.NodeOut grad, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ApplyAdam(Node var, Node m, Node v, Node beta1_power, Node beta2_power, Node lr, Node beta1, Node beta2, Node epsilon, Node grad, @Const @ByRef GraphDefBuilder.Options opts); // Update '*var' according to the Ftrl-proximal scheme. // // accum_new = accum + grad * grad // linear += grad + (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var // quadratic = 1.0 / (accum_new^(lr_power) * lr) + 2 * l2 // var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 // accum = accum_new // // Arguments: // * var: Should be from a Variable(). // * accum: Should be from a Variable(). // * linear: Should be from a Variable(). // * grad: The gradient. // * lr: Scaling factor. Must be a scalar. // * l1: Scaling factor. Must be a scalar. // * l2: Scaling factor. Must be a scalar. // * lr_power: Scaling factor. Must be a scalar. // * opts: // .WithAttr("use_locking", bool): Defaults to false. // If `True`, updating of the var and accum tensors will be protected // by a lock; otherwise the behavior is undefined, but may exhibit less // contention. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Same as "var". @Namespace("tensorflow::ops") public static native Node ApplyFtrl(@ByVal NodeBuilder.NodeOut var, @ByVal NodeBuilder.NodeOut accum, @ByVal NodeBuilder.NodeOut linear, @ByVal NodeBuilder.NodeOut grad, @ByVal NodeBuilder.NodeOut lr, @ByVal NodeBuilder.NodeOut l1, @ByVal NodeBuilder.NodeOut l2, @ByVal NodeBuilder.NodeOut lr_power, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ApplyFtrl(Node var, Node accum, Node linear, Node grad, Node lr, Node l1, Node l2, Node lr_power, @Const @ByRef GraphDefBuilder.Options opts); // Update '*var' by subtracting 'alpha' * 'delta' from it. // // Arguments: // * var: Should be from a Variable(). // * alpha: Scaling factor. Must be a scalar. // * delta: The change. // * opts: // .WithAttr("use_locking", bool): Defaults to false. // If `True`, the subtraction will be protected by a lock; // otherwise the behavior is undefined, but may exhibit less contention. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Same as "var". @Namespace("tensorflow::ops") public static native Node ApplyGradientDescent(@ByVal NodeBuilder.NodeOut var, @ByVal NodeBuilder.NodeOut alpha, @ByVal NodeBuilder.NodeOut delta, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ApplyGradientDescent(Node var, Node alpha, Node delta, @Const @ByRef GraphDefBuilder.Options opts); // Update '*var' according to the momentum scheme. // // accum = accum * momentum + grad // var -= lr * accum // // Arguments: // * var: Should be from a Variable(). // * accum: Should be from a Variable(). // * lr: Scaling factor. Must be a scalar. // * grad: The gradient. // * momentum: Momentum. Must be a scalar. // * opts: // .WithAttr("use_locking", bool): Defaults to false. // If `True`, updating of the var and accum tensors will be protected // by a lock; otherwise the behavior is undefined, but may exhibit less // contention. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Same as "var". @Namespace("tensorflow::ops") public static native Node ApplyMomentum(@ByVal NodeBuilder.NodeOut var, @ByVal NodeBuilder.NodeOut accum, @ByVal NodeBuilder.NodeOut lr, @ByVal NodeBuilder.NodeOut grad, @ByVal NodeBuilder.NodeOut momentum, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ApplyMomentum(Node var, Node accum, Node lr, Node grad, Node momentum, @Const @ByRef GraphDefBuilder.Options opts); // Update '*var' according to the RMSProp algorithm. // // mean_square = decay * mean_square + (1-decay) * gradient ** 2 // Delta = learning_rate * gradient / sqrt(mean_square + epsilon) // // ms <- rho * ms_{t-1} + (1-rho) * grad * grad // mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) // var <- var - mom // // Arguments: // * var: Should be from a Variable(). // * ms: Should be from a Variable(). // * mom: Should be from a Variable(). // * lr: Scaling factor. Must be a scalar. // * rho: Decay rate. Must be a scalar. // * epsilon: Ridge term. Must be a scalar. // * grad: The gradient. // * opts: // .WithAttr("use_locking", bool): Defaults to false. // If `True`, updating of the var, m, and v tensors will be protected // by a lock; otherwise the behavior is undefined, but may exhibit less // contention. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Same as "var". @Namespace("tensorflow::ops") public static native Node ApplyRMSProp(@ByVal NodeBuilder.NodeOut var, @ByVal NodeBuilder.NodeOut ms, @ByVal NodeBuilder.NodeOut mom, @ByVal NodeBuilder.NodeOut lr, @ByVal NodeBuilder.NodeOut rho, @ByVal NodeBuilder.NodeOut momentum, @ByVal NodeBuilder.NodeOut epsilon, @ByVal NodeBuilder.NodeOut grad, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node ApplyRMSProp(Node var, Node ms, Node mom, Node lr, Node rho, Node momentum, Node epsilon, Node grad, @Const @ByRef GraphDefBuilder.Options opts); // var: Should be from a Variable(). // // Arguments: // * opts: // .WithAttr("use_locking", bool): Defaults to false. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node SparseApplyAdadelta(@ByVal NodeBuilder.NodeOut var, @ByVal NodeBuilder.NodeOut accum, @ByVal NodeBuilder.NodeOut accum_update, @ByVal NodeBuilder.NodeOut lr, @ByVal NodeBuilder.NodeOut rho, @ByVal NodeBuilder.NodeOut epsilon, @ByVal NodeBuilder.NodeOut grad, @ByVal NodeBuilder.NodeOut indices, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SparseApplyAdadelta(Node var, Node accum, Node accum_update, Node lr, Node rho, Node epsilon, Node grad, Node indices, @Const @ByRef GraphDefBuilder.Options opts); // Update relevant entries in '*var' and '*accum' according to the adagrad scheme. // // That is for rows we have grad for, we update var and accum as follows: // accum += grad * grad // var -= lr * grad * (1 / sqrt(accum)) // // Arguments: // * var: Should be from a Variable(). // * accum: Should be from a Variable(). // * lr: Learning rate. Must be a scalar. // * grad: The gradient. // * indices: A vector of indices into the first dimension of var and accum. // * opts: // .WithAttr("use_locking", bool): Defaults to false. // If `True`, updating of the var and accum tensors will be protected // by a lock; otherwise the behavior is undefined, but may exhibit less // contention. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Same as "var". @Namespace("tensorflow::ops") public static native Node SparseApplyAdagrad(@ByVal NodeBuilder.NodeOut var, @ByVal NodeBuilder.NodeOut accum, @ByVal NodeBuilder.NodeOut lr, @ByVal NodeBuilder.NodeOut grad, @ByVal NodeBuilder.NodeOut indices, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SparseApplyAdagrad(Node var, Node accum, Node lr, Node grad, Node indices, @Const @ByRef GraphDefBuilder.Options opts); // Update relevant entries in '*var' according to the Ftrl-proximal scheme. // // That is for rows we have grad for, we update var, accum and linear as follows: // accum_new = accum + grad * grad // linear += grad + (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var // quadratic = 1.0 / (accum_new^(lr_power) * lr) + 2 * l2 // var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 // accum = accum_new // // Arguments: // * var: Should be from a Variable(). // * accum: Should be from a Variable(). // * linear: Should be from a Variable(). // * grad: The gradient. // * indices: A vector of indices into the first dimension of var and accum. // * lr: Scaling factor. Must be a scalar. // * l1: Scaling factor. Must be a scalar. // * l2: Scaling factor. Must be a scalar. // * lr_power: Scaling factor. Must be a scalar. // * opts: // .WithAttr("use_locking", bool): Defaults to false. // If `True`, updating of the var and accum tensors will be protected // by a lock; otherwise the behavior is undefined, but may exhibit less // contention. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Same as "var". @Namespace("tensorflow::ops") public static native Node SparseApplyFtrl(@ByVal NodeBuilder.NodeOut var, @ByVal NodeBuilder.NodeOut accum, @ByVal NodeBuilder.NodeOut linear, @ByVal NodeBuilder.NodeOut grad, @ByVal NodeBuilder.NodeOut indices, @ByVal NodeBuilder.NodeOut lr, @ByVal NodeBuilder.NodeOut l1, @ByVal NodeBuilder.NodeOut l2, @ByVal NodeBuilder.NodeOut lr_power, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SparseApplyFtrl(Node var, Node accum, Node linear, Node grad, Node indices, Node lr, Node l1, Node l2, Node lr_power, @Const @ByRef GraphDefBuilder.Options opts); // Update relevant entries in '*var' and '*accum' according to the momentum scheme. // // That is for rows we have grad for, we update var and accum as follows: // // accum = accum * momentum + grad // var -= lr * accum // // Arguments: // * var: Should be from a Variable(). // * accum: Should be from a Variable(). // * lr: Learning rate. Must be a scalar. // * grad: The gradient. // * indices: A vector of indices into the first dimension of var and accum. // * momentum: Momentum. Must be a scalar. // * opts: // .WithAttr("use_locking", bool): Defaults to false. // If `True`, updating of the var and accum tensors will be protected // by a lock; otherwise the behavior is undefined, but may exhibit less // contention. // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node, with output: // Same as "var". @Namespace("tensorflow::ops") public static native Node SparseApplyMomentum(@ByVal NodeBuilder.NodeOut var, @ByVal NodeBuilder.NodeOut accum, @ByVal NodeBuilder.NodeOut lr, @ByVal NodeBuilder.NodeOut grad, @ByVal NodeBuilder.NodeOut indices, @ByVal NodeBuilder.NodeOut momentum, @Const @ByRef GraphDefBuilder.Options opts); @Namespace("tensorflow::ops") public static native Node SparseApplyMomentum(Node var, Node accum, Node lr, Node grad, Node indices, Node momentum, @Const @ByRef GraphDefBuilder.Options opts); // namespace ops // namespace tensorflow // #endif // TENSORFLOW_CC_OPS_TRAINING_OPS_H_ // Parsed from tensorflow/cc/ops/user_ops.h // This file is MACHINE GENERATED! Do not edit. // #ifndef TENSORFLOW_CC_OPS_USER_OPS_H_ // #define TENSORFLOW_CC_OPS_USER_OPS_H_ // #include "tensorflow/core/framework/tensor.h" // #include "tensorflow/core/framework/tensor_shape.h" // #include "tensorflow/core/framework/types.h" // #include "tensorflow/core/graph/graph_def_builder.h" // #include "tensorflow/core/lib/gtl/array_slice.h" // These add a node to the graph from opts. // // Note for "NodeOut" inputs, you will typically either pass // * a {Node*, int index} (to pass the index-th output of that node), or // * a Node* (to pass the first output of that node). // Output a fact about factorials. // // Arguments: // * opts: // .WithName(StringPiece): Set the Node's name // .WithDevice(StringPiece): Set the Node's requested device // .WithControlInput(Node*) / .WithControlInputs({Node*, ...}): // Add control dependencies on the specified Node(s). // // Returns a pointer to the created Node. @Namespace("tensorflow::ops") public static native Node Fact(@Const @ByRef GraphDefBuilder.Options opts); // namespace ops // namespace tensorflow // #endif // TENSORFLOW_CC_OPS_USER_OPS_H_ }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy