chore: import upstream snapshot with attribution
cffconvert / validate (push) Has been skipped
License Check / license-check (push) Failing after 2s

This commit is contained in:
wehub-resource-sync
2026-07-13 12:14:16 +08:00
commit 8a852e4b4e
36502 changed files with 9277225 additions and 0 deletions
+62
View File
@@ -0,0 +1,62 @@
load("//tensorflow:tensorflow.default.bzl", "filegroup")
load(
"//tensorflow:tf_version.bzl",
"MAJOR_VERSION",
"MINOR_VERSION",
"PATCH_VERSION",
"TF_SEMANTIC_VERSION_SUFFIX",
)
load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
package(
# copybara:uncomment default_applicable_licenses = ["//tensorflow:license"],
default_visibility = [
"//tensorflow/core:__subpackages__",
],
licenses = ["notice"],
)
exports_files(
srcs = [
"session.h",
"session_options.h",
"version.h",
],
visibility = ["//visibility:public"],
)
# Export source files needed for mobile builds, which do not use granular targets.
filegroup(
name = "mobile_hdrs_no_runtime",
srcs = [
"version.h",
],
visibility = ["//tensorflow/core:__pkg__"],
)
filegroup(
name = "mobile_hdrs_only_runtime",
srcs = [
"session.h",
"session_options.h",
],
visibility = ["//tensorflow/core:__pkg__"],
)
cc_library(
name = "version",
hdrs = ["version.h"],
visibility = ["//visibility:public"],
)
cc_library(
name = "release_version",
hdrs = ["release_version.h"],
defines = [
"TF_MAJOR_VERSION={}".format(MAJOR_VERSION),
"TF_MINOR_VERSION={}".format(MINOR_VERSION),
"TF_PATCH_VERSION={}".format(PATCH_VERSION),
'TF_VERSION_SUFFIX=\\"{}\\"'.format(TF_SEMANTIC_VERSION_SUFFIX),
],
visibility = ["//visibility:public"],
)
+87
View File
@@ -0,0 +1,87 @@
# TensorFlow
TensorFlow is a computational dataflow graph library.
## Getting started
### Python API example
The following is an example python code to do a simple matrix multiply
of two constants and get the result from a locally-running TensorFlow
process.
First, bring in tensorflow python dependency
//third_party/py/tensorflow
to get the python TensorFlow API.
Then:
```python
import tensorflow as tf
with tf.Session():
input1 = tf.constant(1.0, shape=[1, 1], name="input1")
input2 = tf.constant(2.0, shape=[1, 1], name="input2")
output = tf.matmul(input1, input2)
# Run graph and fetch the output
result = output.eval()
print result
```
### C++ API Example
If you are running TensorFlow locally, link your binary with
//third_party/tensorflow/core
and link in the operation implementations you want to supported, e.g.,
//third_party/tensorflow/core:kernels
An example program to take a GraphDef and run it using TensorFlow
using the C++ Session API:
```c++
#include <memory>
#include <string>
#include <vector>
#include "tensorflow/core/framework/graph.pb.h"
#include "tensorflow/core/public/session.h"
#include "tensorflow/core/framework/tensor.h"
int main(int argc, char** argv) {
// Construct your graph.
tensorflow::GraphDef graph = ...;
// Create a Session running TensorFlow locally in process.
std::unique_ptr<tensorflow::Session> session(tensorflow::NewSession({}));
// Initialize the session with the graph.
tensorflow::Status s = session->Create(graph);
if (!s.ok()) { ... }
// Specify the 'feeds' of your network if needed.
std::vector<std::pair<string, tensorflow::Tensor>> inputs;
// Run the session, asking for the first output of "my_output".
std::vector<tensorflow::Tensor> outputs;
s = session->Run(inputs, {"my_output:0"}, {}, &outputs);
if (!s.ok()) { ... }
// Do something with your outputs
auto output_vector = outputs[0].vec<float>();
if (output_vector(0) > 0.5) { ... }
// Close the session.
session->Close();
return 0;
}
```
For a more fully-featured C++ example, see
`tensorflow/cc/tutorials/example_trainer.cc`
+50
View File
@@ -0,0 +1,50 @@
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_PUBLIC_RELEASE_VERSION_H_
#define TENSORFLOW_CORE_PUBLIC_RELEASE_VERSION_H_
// A cc_library //third_party/tensorflow/core/public:release_version provides
// defines with the version data from //third_party/tensorflow/tf_version.bzl.
// The version suffix can be set by passing the build parameters
// --repo_env=ML_WHEEL_BUILD_DATE=<date> and
// --repo_env=ML_WHEEL_VERSION_SUFFIX=<suffix>.
// To update the project version, update tf_version.bzl.
#define _TF_STR_HELPER(x) #x
#define _TF_STR(x) _TF_STR_HELPER(x)
#ifndef TF_MAJOR_VERSION
#error "TF_MAJOR_VERSION is not defined!"
#endif
#ifndef TF_MINOR_VERSION
#error "TF_MINOR_VERSION is not defined!"
#endif
#ifndef TF_PATCH_VERSION
#error "TF_PATCH_VERSION is not defined!"
#endif
#ifndef TF_VERSION_SUFFIX
#error "TF_VERSION_SUFFIX is not defined!"
#endif
// e.g. "0.5.0" or "0.6.0-alpha".
#define TF_VERSION_STRING \
(_TF_STR(TF_MAJOR_VERSION) "." _TF_STR(TF_MINOR_VERSION) "." _TF_STR( \
TF_PATCH_VERSION) TF_VERSION_SUFFIX)
#endif // TENSORFLOW_CORE_PUBLIC_RELEASE_VERSION_H_
+362
View File
@@ -0,0 +1,362 @@
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_PUBLIC_SESSION_H_
#define TENSORFLOW_CORE_PUBLIC_SESSION_H_
#include <string>
#include <utility>
#include <vector>
#include "absl/status/status.h"
#include "tensorflow/core/framework/device_attributes.pb.h"
#include "tensorflow/core/framework/graph.pb.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/lib/core/status.h"
#include "tensorflow/core/platform/env.h"
#include "tensorflow/core/platform/threadpool_options.h"
#include "tensorflow/core/protobuf/config.pb.h"
#include "tensorflow/core/public/session_options.h"
namespace tensorflow {
class DeviceMgr;
/// \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:
///
/// ```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<tensorflow::Session>
/// 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<tensorflow::Tensor> 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<float>();
/// 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.
class Session {
public:
Session();
virtual ~Session();
/// \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.
virtual absl::Status Create(const GraphDef& graph) = 0;
#ifndef SWIG
virtual absl::Status Create(GraphDef&& graph) { return Create(graph); }
#endif
/// \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.
virtual absl::Status Extend(const GraphDef& graph) = 0;
#ifndef SWIG
virtual absl::Status Extend(GraphDef&& graph) { return Extend(graph); }
#endif
/// \brief Runs the graph with the provided input tensors and fills
/// `outputs` for the endpoints specified in `output_tensor_names`.
/// Runs to but does not return Tensors for the nodes in
/// `target_tensor_names`.
///
/// The order of tensors in `outputs` will match the order provided
/// by `output_tensor_names`.
///
/// If `Run` returns `OK()`, then `outputs->size()` will be equal to
/// `output_tensor_names.size()`. If `Run` does not return `OK()`, the
/// state of `outputs` is undefined.
///
/// REQUIRES: The name of each Tensor of the input or output must
/// match a "Tensor endpoint" in the `GraphDef` passed to `Create()`.
///
/// REQUIRES: At least one of `output_tensor_names` and
/// `target_tensor_names` must be non-empty.
///
/// REQUIRES: outputs is not nullptr if `output_tensor_names` is non-empty.
virtual absl::Status Run(
const std::vector<std::pair<std::string, Tensor> >& inputs,
const std::vector<std::string>& output_tensor_names,
const std::vector<std::string>& target_tensor_names,
std::vector<Tensor>* outputs) = 0;
/// \brief Implementations which support `RunOptions`.
//
/// NOTE: This API is still experimental and may change.
virtual absl::Status Create(const RunOptions& run_options,
const GraphDef& graph) {
return absl::UnimplementedError(
"Create(const RunOptions& run_options, const GraphDef& graph) is not "
"supported for this session.");
}
virtual absl::Status Extend(const RunOptions& run_options,
const GraphDef& graph) {
return absl::UnimplementedError(
"Extend(const RunOptions& run_options, const GraphDef& graph) is not "
"supported for this session.");
}
#ifndef SWIG
virtual absl::Status Create(const RunOptions& run_options, GraphDef&& graph) {
return Create(run_options, graph);
}
virtual absl::Status Extend(const RunOptions& run_options, GraphDef&& graph) {
return Extend(run_options, graph);
}
#endif
virtual absl::Status Close(const RunOptions& run_options) {
return absl::UnimplementedError(
"Close(const RunOptions& run_options) is not supported for this "
"session.");
}
/// \brief Like `Run`, but allows users to pass in a `RunOptions` proto and
/// to retrieve non-Tensor metadata output via a `RunMetadata` proto for this
/// step. `run_metadata` may be nullptr, in which case any metadata output is
/// discarded.
/// NOTE: This API is still experimental and may change.
virtual absl::Status Run(
const RunOptions& run_options,
const std::vector<std::pair<std::string, Tensor> >& inputs,
const std::vector<std::string>& output_tensor_names,
const std::vector<std::string>& target_tensor_names,
std::vector<Tensor>* outputs, RunMetadata* run_metadata);
/// \brief Like `Run` with `RunOptions` proto, but allows user to provide
/// custom threadpool implementation via ThreadPoolOptions.
/// NOTE: This API is still experimental and may change.
virtual absl::Status Run(
const RunOptions& run_options,
const std::vector<std::pair<std::string, Tensor> >& inputs,
const std::vector<std::string>& output_tensor_names,
const std::vector<std::string>& target_tensor_names,
std::vector<Tensor>* outputs, RunMetadata* run_metadata,
const thread::ThreadPoolOptions& threadpool_options) {
return absl::UnimplementedError(
"Run with threadpool is not supported for this session.");
}
/// \brief Sets up a graph for partial execution. All future feeds and
/// fetches are specified by `input_names` and `output_names`. Returns
/// `handle` that can be used to perform a sequence of partial feeds and
/// fetches.
/// NOTE: This API is still experimental and may change.
virtual absl::Status PRunSetup(const std::vector<std::string>& input_names,
const std::vector<std::string>& output_names,
const std::vector<std::string>& target_nodes,
std::string* handle);
/// \brief Continues the pending execution specified by `handle` with the
/// provided input tensors and fills `outputs` for the endpoints specified
/// in `output_names`.
/// NOTE: This API is still experimental and may change.
virtual absl::Status PRun(
const std::string& handle,
const std::vector<std::pair<std::string, Tensor> >& inputs,
const std::vector<std::string>& output_names,
std::vector<Tensor>* outputs);
/// \brief List devices in the session.
///
/// Retrieves the list of available devices within the session, and populates
/// *response. This API is optional. If it is unimplemented, Status will
/// return a corresponding error message, and *response will be unmodified.
virtual absl::Status ListDevices(std::vector<DeviceAttributes>* response) = 0;
/// \brief Closes this session.
///
/// Closing a session releases the resources used by this session
/// on the TensorFlow runtime (specified during session creation by
/// the `SessionOptions::target` field).
virtual absl::Status Close() = 0;
// NOTE(ashankar): As of July 2017, this method was added to facilitate some
// experimentation. Reconsider/re-evaluate after September 2017.
//
// Sets `*output` to the `DeviceMgr` that owns accessible devices in the
// address-space of the caller.
virtual absl::Status LocalDeviceManager(const DeviceMgr** output) {
return absl::UnimplementedError(
"LocalDeviceManager is not supported for this session.");
}
/// \brief A handle to a subgraph, created with `Session::MakeCallable()`.
typedef int64_t CallableHandle;
/// \brief Creates a `handle` for invoking the subgraph defined by
/// `callable_options`.
/// NOTE: This API is still experimental and may change.
virtual absl::Status MakeCallable(const CallableOptions& callable_options,
CallableHandle* out_handle) {
return absl::UnimplementedError(
"MakeCallable is not supported for this session.");
}
/// \brief Invokes the subgraph named by `handle` with the given options and
/// input tensors.
///
/// The order of tensors in `feed_tensors` must and `fetch_tensors` will
/// match the order of names in `CallableOptions::feed()` and
/// `CallableOptions::fetch()` when this subgraph was created.
/// NOTE: This API is still experimental and may change.
virtual absl::Status RunCallable(CallableHandle handle,
const std::vector<Tensor>& feed_tensors,
std::vector<Tensor>* fetch_tensors,
RunMetadata* run_metadata) {
return absl::UnimplementedError(
"RunCallable is not supported for this session.");
}
/// \brief Invokes the subgraph named by `handle` with the given options and
/// input tensors. User can provide custom threadpool implementation via
/// threadpool_options.
///
/// The order of tensors in `feed_tensors` must and `fetch_tensors` will
/// match the order of names in `CallableOptions::feed()` and
/// `CallableOptions::fetch()` when this subgraph was created.
/// NOTE: This API is still experimental and may change.
virtual absl::Status RunCallable(
CallableHandle handle, const std::vector<Tensor>& feed_tensors,
std::vector<Tensor>* fetch_tensors, RunMetadata* run_metadata,
const thread::ThreadPoolOptions& threadpool_options) {
return absl::UnimplementedError(
"RunCallable with threadpool is not supported for this session.");
}
/// \brief Releases resources associated with the given `handle` in this
/// session.
/// NOTE: This API is still experimental and may change.
virtual absl::Status ReleaseCallable(CallableHandle handle) {
return absl::UnimplementedError(
"ReleaseCallable is not supported for this session.");
}
/// \brief Release global graph-related state in this session.
///
/// After calling `this->Finalize()`, calls to `this->Run()` with previously
/// unseen feeds and fetches, and calls to `this->MakeCallable()` will fail.
/// Using `MakeCallable()` and `RunCallable()` is recommended, because
/// explicit callable creation makes it clearer where the `Finalize()` call
/// should be placed.
///
/// This API can be used in conjunction with a "warmup" phase to reduce the
/// memory consumed by the session:
///
/// 1. Call `Session::Create()`.
/// 2. Call `Session::MakeCallable()` for all subgraphs that you will execute
/// in the session.
/// 3. Call `Session::Finalize()` to release global graph-related state.
/// 4. Call `Session::RunCallable()` with the handle(s) created in step 2.
///
/// NOTE: This API is still experimental and may change.
virtual absl::Status Finalize() {
return absl::UnimplementedError(
"Finalize is not supported for this session.");
}
};
/// \brief Create a new session with the given options.
///
/// If session creation succeeds, the new `Session` will be stored in
/// `*out_session`, the caller will take ownership of the returned
/// `*out_session`, and this function will return `OK()`. Otherwise, this
/// function will return an error status and set *out_session to nullptr.
absl::Status NewSession(const SessionOptions& options, Session** out_session);
/// \brief Resets resource containers associated with a target.
///
/// Reset() allows misbehaving or slow sessions to be aborted and closed, and
/// causes their resources eventually to be released. Reset() does not wait
/// for the computations in old sessions to cease; it merely starts the
/// process of tearing them down. However, if a new session is started after
/// a Reset(), the new session is isolated from changes that old sessions
/// (started prior to the Reset()) may continue to make to resources, provided
/// all those resources are in containers listed in "containers".
///
/// Old sessions may continue to have side-effects on resources not in
/// containers listed in "containers", and thus may affect future
/// sessions' results in ways that are hard to predict. Thus, if well-defined
/// behavior is desired, it is recommended that all containers be listed in
/// "containers".
///
/// `containers` is a vector of string representation of resource container
/// names. When a resource container is reset, the resources held by the
/// container will be released. In particular, all Variables in the container
/// will become undefined. If the "containers" vector is empty, the default
/// container is assumed. If the "containers" vector is non-empty, the
/// default container should be listed explicitly.
///
/// If Reset succeeds, this function will return `OK()`. Otherwise, this
/// function will return an error status.
absl::Status Reset(const SessionOptions& options,
const std::vector<std::string>& containers);
/// \brief Create a new session with the given options.
///
/// If a new `Session` object could not be created, this function will
/// return nullptr.
///
/// *Strongly prefer* the version of NewSession that returns Status,
/// which contains more helpful error information.
Session* NewSession(const SessionOptions& options);
/// \brief Export the metric that indicates the session is created.
void SetSessionCreatedMetric();
} // end namespace tensorflow
#endif // TENSORFLOW_CORE_PUBLIC_SESSION_H_
+66
View File
@@ -0,0 +1,66 @@
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_PUBLIC_SESSION_OPTIONS_H_
#define TENSORFLOW_CORE_PUBLIC_SESSION_OPTIONS_H_
#include <string>
#include "tensorflow/core/protobuf/config.pb.h"
namespace tsl {
class Env;
} // namespace tsl
namespace tensorflow {
/// Configuration information for a Session.
struct SessionOptions {
/// The environment to use.
tsl::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.
std::string target;
/// Configuration options.
ConfigProto config;
SessionOptions();
};
} // end namespace tensorflow
#endif // TENSORFLOW_CORE_PUBLIC_SESSION_OPTIONS_H_
+112
View File
@@ -0,0 +1,112 @@
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_PUBLIC_VERSION_H_
#define TENSORFLOW_CORE_PUBLIC_VERSION_H_
// TensorFlow uses semantic versioning, see http://semver.org/.
#define TF_STR_HELPER(x) #x
#define TF_STR(x) TF_STR_HELPER(x)
// GraphDef compatibility versions (the versions field in graph.proto).
//
// Each graph has producer and min_consumer versions, and each
// consumer has its own version and a min_producer. In addition, graphs can
// mark specific consumer versions as bad (to prevent bugs from executing).
// A consumer will execute a graph if the consumer's version is at least the
// graph's min_consumer, the graph's producer version is at least the consumer's
// min_producer, and the consumer version isn't specifically disallowed by the
// graph.
//
// By default, newly created graphs have producer version TF_GRAPH_DEF_VERSION
// min_consumer TF_GRAPH_DEF_MIN_CONSUMER, and no other bad consumer versions.
//
// Version history:
//
// 0. Graphs created before GraphDef versioning
// 1. First real version (2dec2015)
// 2. adjust_contrast only takes float, doesn't perform clamping (11dec2015)
// 3. Remove TileGrad, since it was equivalent to reduce_sum (30dec2015)
// 4. When support for this version is removed, we can safely make AttrValue
// parsing more strict with respect to empty list values (see
// 111635679, 7jan2016).
// 5. Graphs are wholly-validated during Session::Create() (7jan2016).
// 6. TensorFlow is scalar strict within Google (27jan2016).
// 7. Remove TopK in favor of TopKV2 (5feb2016).
// 8. Replace RandomCrop from C++ with pure Python (5feb2016).
// 9. Deprecate batch_norm_with_global_normalization (16feb2016).
// 10. Deprecate conv3d_backprop_{filter,input} (10jun2016).
// 11. Deprecate {batch}_self_adjoint_eig (3aug2016).
// 12. Graph consumers understand the node_def field of FunctionDef (22aug2016).
// 13. Deprecate multiple batch linear algebra ops (9sep2016).
// 14. Deprecate batch_matrix_* ops. (10sep2016).
// 15. Deprecate batch_fft_* ops. (14sep2016).
// 16. Deprecate tensor_array (v1) ops in favor of v2 (10nov2016).
// 17. Deprecate inv (11nov2016).
// 17. Expose reverse_v2 (10nov2016)
// 18. Add VariableV2 (30nov2016)
// 19. Deprecated ops created by models moved out of core SkipGram, NegTrain.
// (08dec2016)
// 20. Catch all version 1.0 changes to Python API generation. SplitV is now
// used for tf.split, ReverseV2 is now used by tf.reverse, ConcatV2 is
// now used by tf.concat. Graphs use flooring
// division and mod semantics. TensorArrayV3. (12dec2016)
// Also considered the version for when it is required for reduction
// ops' indices to be scalar or vector, and not higher rank.
// Some earlier graph def versions allowed this.
// 21. Dropped FunctionDef.Node support, switched to node_def introduced
// in version 12. (11jan2017)
// 22. Placeholder now can specify and enforce scalar and partial
// shapes, particularly when restoring a graph from GraphDef
// produced at version 22 or later. (04/10/2016)
// 23. Remove NonMaxSuppression in favor of NonMaxSuppressionV2.
// 24. Deprecate lookup ops (v1) ops in favor of v2 (30may2017)
// 25. Deprecate stack (v1) ops in favor of v2 (2017/6/15).
// 25. Deprecate RandomPoisson (v1) ops in favor of v2 (2017/10/25).
// 26. Add a bool 'stripped_default_attrs' to MetaInfoDef indicating
// whether default-valued attrs have been stripped from the nodes in the
// GraphDef. (7dec2017)
// 27. Deprecate TensorArray ops v2 in favor of v3 and deprecated io_ops
// deprecated in favor of V2 ops. (2018/01/23)
// 28. Deprecate MatrixExponential op in favor of Python implementation.
// (2018/08/21).
// (2019/02/15). Added `control_ret` field to FunctionDef proto, and
// `control_output` field to OpDef proto.
// 29. Deprecate StatefulStandardNormal op in favor of StatefulStandardNormalV2.
// (2019/03/25).
// (2019/04/17). Added `arg_attr` field to FunctionDefProto.
// 30. (2019/05/09) First date based GraphDef version. GraphDef
// versions advance by 1 each day after this point.
#define TF_GRAPH_DEF_VERSION_MIN_PRODUCER 0
#define TF_GRAPH_DEF_VERSION_MIN_CONSUMER 0
#define TF_GRAPH_DEF_VERSION 2474 // Updated: 2026/1/16
// Checkpoint compatibility versions (the versions field in SavedSliceMeta).
//
// The checkpoint versions have the same semantics as GraphDef versions, but the
// numbering scheme is separate. We have no plans to ever deprecate checkpoint
// versions, but it's good to have this in place in case we ever need to.
//
// Version history:
//
// 0. Checkpoints saved before checkpoint versioning.
// 1. First real version (10feb2015).
#define TF_CHECKPOINT_VERSION_MIN_PRODUCER 0
#define TF_CHECKPOINT_VERSION_MIN_CONSUMER 0
#define TF_CHECKPOINT_VERSION 1
#endif // TENSORFLOW_CORE_PUBLIC_VERSION_H_