aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/graph/graph_constructor_test.cc
Commit message (Collapse)AuthorAge
* Fix GraphConstructor and import_graph_def bug with variadic ops.Gravatar Skye Wanderman-Milne2018-09-17
| | | | | | | | | | | | | Prior to this change, GraphConstructor::PopulateMissingUnusedInputMapKey() didn't correctly compute the number of outputs for ops with variadic outputs. This meant that missing_unused_input_map_keys could contain spurious entries for unused variadic outputs, which could trigger a ValueError in import_graph_def. This also adds a new util method in node_def_util.h, NumOutputsForNode(). PiperOrigin-RevId: 213353158
* Removed redundant std::string -> string conversions.Gravatar A. Unique TensorFlower2018-08-28
| | | | PiperOrigin-RevId: 210565027
* Make ImportGraphDefOptions and ImportGraphDefResults own all strings.Gravatar Skye Wanderman-Milne2018-06-21
| | | | | | | | | | | This change introduces SafeTensorId, an alternative to TensorId that uses strings instead of StringPieces. It makes ImportGraphDefOptions/Results use SafeTensorIds instead of TensorIds so the caller isn't responsible for managing the string lifetime. import_graph_def in Python was broken before this change, although it wasn't caught in tests. PiperOrigin-RevId: 201622030
* Fix typo in error message.Gravatar Patrick Nguyen2018-05-23
| | | | PiperOrigin-RevId: 197741341
* Replaced calls to tensorflow::StringPiece::ToString with std::string ↵Gravatar A. Unique TensorFlower2018-05-07
| | | | | | | | | | conversions. That is, instances of sp.ToString() are replaced with std::string(sp). This will allow tensorflow::StringPiece::ToString to be removed, which is necessary before it can be replaced with absl::string_view. PiperOrigin-RevId: 195689392
* More informative error message when loading a graph_def which uses unknown ops.Gravatar Malcolm Reynolds2018-04-26
| | | | | | Fixes #17014 PiperOrigin-RevId: 194472083
* Replaced calls to deprecated tensorflow::StringPiece methods with theirGravatar A. Unique TensorFlower2018-04-02
| | | | | | | | tensorflow::str_util equivalents. This will allow the deprecated methods to be removed. PiperOrigin-RevId: 191316903
* import_graph_def: support "absolute" names with the C API enabled.Gravatar Skye Wanderman-Milne2018-02-09
| | | | | | | | | | | | | | | | | | | | Passing a name with a trailing '/' to import_graph_def causes that name to be used as-is (i.e. it is not appended to the existing name scope and not de-duped with any existing name scopes. This is in order to re-use an existing name scope). This didn't work with the C API enabled because it was set to always have the C API uniquify the prefix. The fix is to not uniquify the prefix, since calling name_scope in import_graph_def already has the logic to uniquify the prefix if necessary. I'm not sure why I thought we needed the C API to do this to being with. In addition, this changes the graph_constructor.cc logic to uniquify names if the prefix cannot be guaranteed unique (see the new test case in graph_constructor_test.cc for why/when this is necessary). PiperOrigin-RevId: 185215326
* Enabled XLA for TF C API.Gravatar Mingsheng Hong2018-02-09
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary of changes: 1. Set MarkForCompilationPassFlags::tf_xla_cpu_global_jit default to true in C_API unit test env when XLA-execute is intended. Together with setting session config config.graph_options.optimizer_options.global_jit_level to > 0, this turns on XLA for the entire graph (eligible nodes only, with _Arg and _RetVal nodes excluded). We decided against defaulting MarkForCompilationPassFlags::tf_xla_cpu_global_jit to true, due to performance concerns with the single-threaded nature of the XLA CPU backend (see https://www.tensorflow.org/performance/xla/jit#turning_on_jit_compilation). 2. In FindCompilationCandidates() during MarkForCompilationPass, skip compiling any '_Arg'-typed nodes. This is necessary to avoid hitting a "Invalid argument number" error during MarkForCompilationPass. 3. Extended C API based build rules to link in XLA libraries, and added unit test "CAPI.Session_Min_XLA_CPU". Also added some misc improvements and debugging aids. PiperOrigin-RevId: 185193314
* Raise exception on missing unused input_map keys with C API enabled.Gravatar Skye Wanderman-Milne2017-12-12
| | | | | | | | | | | | | | | | | Without this change, the C++ ImportGraphDef API returns unused input_map keys (which are plumbed through to the C API as well). However, the Python import_graph_def API requires slightly different semantics: it throws an error for unused input_map keys that are missing from the GraphDef. This change modifies the C and C++ APIs to limit the returned keys to those missing from the GraphDef, and plumbs this through to the C API-enabled import_graph_def implementation. Note that this is a change to the existing C API. Luckily the modified method hasn't been released yet, so it's ok to change it. PiperOrigin-RevId: 178783957
* Add ImportGraphDefOptions::uniquify_prefix.Gravatar Skye Wanderman-Milne2017-12-05
| | | | | | | This option is necessary to mimic the Python import_graph_def method's behavior. PiperOrigin-RevId: 177986165
* Fix bug with uniquified colocation attrs in ImportGraphDef.Gravatar Skye Wanderman-Milne2017-12-04
| | | | | | | | | | | | | | | | The colocation attrs must be updated after all NodeDefs have been processed. The nodes are processed and uniquified in topological order, which allows us to update the inputs simultaneously due to the topological ordering, but this doesn't work for the colocation groups. I also considered updating all the NodeDefs with prefixes or unique names at the very beginning, before starting conversion. This would make the logic simpler, but require us to potentially keep a full copy of all the NodeDefs in memory (so we could edit them), so I decided to edit in-place after construction. We might want to consider this alternate in future though. PiperOrigin-RevId: 177890362
* Fix edge case with ImportGraphDefOption.uniquify_names = true.Gravatar Skye Wanderman-Milne2017-12-04
| | | | | | | | | | | | | | | This change fixes the case where a newly-generated uniquified name conflicts with another NodeDef being imported (the original NodeDef names are required to be unique among each other, so this is only an issue when we create new names). Note that this behavior is not well defined in the Python import_graph_def method. It will always generate unique names, but the exact naming scheme may depend on the order the NodeDefs are imported. I didn't write a corresponding Python unit test or try to make this change produce the same names for this reason. PiperOrigin-RevId: 177872720
* Enable ImportGraphDef to import unbound graph when input_map maps all unboundGravatar A. Unique TensorFlower2017-11-13
| | | | | | | | | | | inputs. tf.import_graph_def() in Python allows to import graphs with unbound input when proper input_map is provided, but tensorflow::ImportGraphDef() does not allow importing such graphs. Because of this difference, using the same graph in Python and C++ results in different output (ok vs error). PiperOrigin-RevId: 175600872
* Simplify graph construction with an option to not validate colocation ↵Gravatar Yao Zhang2017-11-10
| | | | | | constraints (for graph optimizations, colocation constraints are already validated previously and device placement of nodes has completed previously and there is no need to validate again). PiperOrigin-RevId: 175113956
* Add uniquify_names option to ImportGraphDef.Gravatar Skye Wanderman-Milne2017-11-03
| | | | | | | | | | This option allows ImportGraphDef to mimic the behavior of the Python import_graph_def function, which automatically creates unique node names instead of raising an exception (this is due to the Python op construction logic, not import_graph_def directly). This change is a steps towards switching import_graph_def to use the C API version. PiperOrigin-RevId: 174541334
* Add return_nodes option to ImportGraphDefGravatar Skye Wanderman-Milne2017-10-16
| | | | | | | | | | | | The is similar to the return_tensors option. return_tensors cannot be used to fetch nodes with no outputs, so return_nodes is necessary. In addition, this change also refactors the ImportGraphDef signature to return all optional return values in a single struct. This is to keep the ImportGraphDef signature from getting too long, and also makes the call sites simpler. PiperOrigin-RevId: 172388270
* Add optional unused_input_map_keys output param to ImportGraphDefGravatar Skye Wanderman-Milne2017-10-04
| | | | | | | This is a more general feature than that in the Python importer, which raises an exception if the input map contains unused names. PiperOrigin-RevId: 171029316
* More C++ while loop validationGravatar Skye Wanderman-Milne2017-09-07
| | | | | | | | | | | | | With this change, we call IsValidOutputTensor() on the returned outputs from the condition and body functions. This will return a bad status if no output or a null output is set, or if an output has a bad index. This also adds unit tests for related error cases to the C and C++ unit tests. They often produce different errors because the C implementation goes through the graph constructor. PiperOrigin-RevId: 167925641
* Don't create cond_input and body_input nodes when finishing while loopGravatar Igor Ganichev2017-08-19
| | | | | | | | These nodes are not needed, but they caused failures in functions with while loops because functions currently execute all ops in their bodies and these ops are placeholders without feeds. PiperOrigin-RevId: 165814802
* Merge changes from github.Gravatar A. Unique TensorFlower2017-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | END_PUBLIC --- Commit 9f81374c3 authored by raymondxyang<zihao.yang@microsoft.com> Committed by Rasmus Munk Larsen<rmlarsen@google.com>: Add option for build more python tests in Cmake (#11853) * Ignore Windows built project * Fix deprecated methods in tf.contrib.python * Fix regex match for Windows build in contrib.keras * Fix Regex match for Windows build in session_bundle * * Fix deprecated methods * Fix regex match for Windows * Fix compatibility issue with Python 3.x * Add missing ops into Windows build for test * Enabled more testcases for Windows build * Clean code and fix typo * Add conditional cmake mode for enabling more unit testcase * Add Cmake mode for major Contrib packages * Add supplementary info in RAEDME for new cmake option * * Update tf_tests after testing with TF 1.3 * Clean code and resolve conflicts * Fix unsafe regex matches and format code * Update exclude list after testing with latest master branch * Fix missing module --- Commit 98f0e1efe authored by Yong Tang<yong.tang.github@outlook.com> Committed by Rasmus Munk Larsen<rmlarsen@google.com>: Dynamic ksize and strides with MaxPool (#11875) * Dynamic ksize with max_pool This fix tries to fix the issue raised in 4746 where ksize is static (attr) with max_pool. This fix changes ksize to input tensor so that it is dynamic now. This fix fixes 4746. Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Add dynamic ksize to MaxPoolGrad and MaxPoolGradGrad Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Add test cases for max_pool_v2 Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Fix GPU Jenkins issue. Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Enable MaxPoolV2 in GPU Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Hide MaxPoolV2 and other fixes. Signed-off-by: Yong Tang <yong.tang.github@outlook.com> --- Commit 02d6bc185 authored by Bairen Yi<byronyi@users.noreply.github.com> Committed by Rasmus Munk Larsen<rmlarsen@google.com>: remove useless variable (#12212) --- Commit ed6b0d905 authored by namrata-ibm<bhavenamrata@gmail.com> Committed by Rasmus Munk Larsen<rmlarsen@google.com>: Adding support for s390x in calculation of cpu_frequency (#12201) --- Commit 627dfc9dd authored by Taehoon Lee<taehoonlee@snu.ac.kr> Committed by Taehoon Lee<taehoonlee@snu.ac.kr>: Fix typos --- Commit c0f9b0a91 authored by A. Unique TensorFlower<gardener@tensorflow.org> Committed by TensorFlower Gardener<gardener@tensorflow.org>: In fast-math mode emit a tanh that has a faster min/max. PiperOrigin-RevId: 164943597 --- Commit 87605f3d6 authored by Kay Zhu<kayzhu@google.com> Committed by TensorFlower Gardener<gardener@tensorflow.org>: [TF:XLA] Use HloEvaluator for ComputeConstant, remove the need of a dedicated compute constant backend. PiperOrigin-RevId: 164940970 --- Commit 881de45c2 authored by Taehoon Lee<me@taehoonlee.com> Committed by Rasmus Munk Larsen<rmlarsen@google.com>: Add bool type supports for GPU kernels (#11927) * Add bool type supports for GPU kernels * Add bool type test codes for GPU kernels --- Commit eeacdcdb1 authored by A. Unique TensorFlower<gardener@tensorflow.org> Committed by TensorFlower Gardener<gardener@tensorflow.org>: Add missing "CPU" suffix in registrations. PiperOrigin-RevId: 164939527 --- Commit de01be952 authored by namrata-ibm<bhavenamrata@gmail.com> Committed by Rasmus Munk Larsen<rmlarsen@google.com>: Adding support for Big Endian in graph_constructor_test and wav_io (#12179) --- Commit 26719d29f authored by QingYing Chen<pkudysj@126.com> Committed by Rasmus Munk Larsen<rmlarsen@google.com>: Implement CRF decode (Viterbi decode) for tensor (#12056) * Implement CRF decoding for tensors * add test code for tensor version's CRF decoding * made modifications according to pylint * add some comments for crf decode * remove useless code * add comments at the top comment of crf module and add more comments in crf_test * capitalize first char of first word in comments * replace crf_decode test code with a deterministic example --- Commit f9a81ca2f authored by Pete Warden<pete@petewarden.com> Committed by gunan<gunan@google.com>: Create CI build script for Raspberry Pi (#12190) * Create CI build script for Raspberry Pi * Moved location of Pi build script --- Commit e2a163a90 authored by A. Unique TensorFlower<gardener@tensorflow.org> Committed by TensorFlower Gardener<gardener@tensorflow.org>: Merge code from PR #11940 with internal changes from cl/164796436, and update Python tests to also run on GPU. PiperOrigin-RevId: 164929133 --- Commit 08bbfa187 authored by Taehoon Lee<me@taehoonlee.com> Committed by Rasmus Munk Larsen<rmlarsen@google.com>: Fix typos (#12195) --- Commit ab96f41fb authored by Luke Iwanski<luke@codeplay.com> Committed by Rasmus Munk Larsen<rmlarsen@google.com>: [OpenCL] Extends matmul_benchmark.py to cover SYCL (#11697) * [OpenCL] Extends matmul_benchmark.py to cover SYCL * Fixed typo * /gpu:0 -> /device:GPU:0 * Fixes control_flow_ops_py_test * /gpu: -> /device:GPU: * Fixes //tensorflow/python/profiler/internal:run_metadata_test * gpu: -> GPU: * Fixes tfprof_node * [OpenCL] Fixes device path to name with many colons (#123) The device path is constructed from a device name by replacing all colons with underscores. Some device names contain more than one colon, for example 'device:SYCL:0' which gives a path 'device_SYCL_0'. The previous code would not convert this back to the original device name, but rather to 'device:SYCL_0'. An alternative fix would be to convert all underscores to colons in the device name (i.e. remove the restriction inside `replace("_", ":", 1)`), however I'm not sure if there are any device names which contain underscores. * If no gpu device aviable fake one * gpu: -> device:GPU * Fixes profiler test * /gpu:x -> /device:GPU:x * Fixes debug_io_utils_test.cc test * Fixes device_name_utils_test.cc --- Commit 35e7a3665 authored by Yong Tang<yong.tang.github@outlook.com> Committed by Rasmus Munk Larsen<rmlarsen@google.com>: Remove unneeded casting of int64 for reverse_sequence (#12192) This fix remove unneeded cast of int64 for reverse_sequence: ``` lengths = math_ops.to_int64(lengths) ``` as int32 has already been enabled for reverse_sequence. Signed-off-by: Yong Tang <yong.tang.github@outlook.com> --- Commit 9fba8c185 authored by Anna R<annarev@google.com> Committed by TensorFlower Gardener<gardener@tensorflow.org>: Add benchmark dashboard link to benchmarks doc. Also, I added a link and description for Benchmarks page to Community index page. PiperOrigin-RevId: 164924906 --- Commit bb6f32fa7 authored by Mark Heffernan<meheff@google.com> Committed by TensorFlower Gardener<gardener@tensorflow.org>: Make HloAliasAnalysis updatable after changes to the HLO graph. As part of this change make HloAliasAnalysis a thinner layer which basically only holds a map from HloValue to HloBuffer and vice versa. PiperOrigin-RevId: 164923041 --- Commit 9103096c1 authored by A. Unique TensorFlower<gardener@tensorflow.org> Committed by Thomas K?ppe<tkoeppe@google.com>: Merged commit includes the following changes: 164923041 by meheff: Make HloAliasAnalysis updatable after changes to the HLO graph. As part of this change make HloAliasAnalysis a thinner layer which basically only holds a map from HloValue to HloBuffer and vice versa. -- PiperOrigin-RevId: 164923041 --- Commit 822603aed authored by A. Unique TensorFlower<gardener@tensorflow.org> Committed by TensorFlower Gardener<gardener@tensorflow.org>: Merging sibling fusion instruction using multi_output_fusion PiperOrigin-RevId: 164920220 --- Commit c035aa2a8 authored by A. Unique TensorFlower<gardener@tensorflow.org> Committed by TensorFlower Gardener<gardener@tensorflow.org>: Go: Update generated wrapper functions for TensorFlow ops. PiperOrigin-RevId: 164917891 --- Commit e1e81d9ba authored by Luke Iwanski<luke@codeplay.com> Committed by Rasmus Munk Larsen<rmlarsen@google.com>: [OpenCL] Fixes double memcpy bug (#151) (#12173) * [OpenCL] Fixes double memcpy bug (#151) As the debg CopyOp is called on a Tensor without type, we need to use the DataType enum to get type information, and use this to pass the type on to Eigen. This is a workaround Eigen's need to have a type when calling memcpy. If the Eigen memcpy can be provided without a type requirement, then the memcpy in sycl_util is unnecessary. * Acts on feedback from: #12173/files/32cb12a9001b672425867b5a3110fd98e737a20b#r132496277 --- Commit d9ca2d86d authored by A. Unique TensorFlower<gardener@tensorflow.org> Committed by TensorFlower Gardener<gardener@tensorflow.org>: Internal change PiperOrigin-RevId: 164916465 --- Commit b8d13d218 authored by A. Unique TensorFlower<gardener@tensorflow.org> Committed by TensorFlower Gardener<gardener@tensorflow.org>: Remove more parts of DCASGD missed in the first pass. (47949b) PiperOrigin-RevId: 164914552 --- Commit 73b3d52c7 authored by Alexandre Passos<apassos@google.com> Committed by TensorFlower Gardener<gardener@tensorflow.org>: cmake fix PiperOrigin-RevId: 164911656 --- Commit 2173b5b0a authored by A. Unique TensorFlower<gardener@tensorflow.org> Committed by TensorFlower Gardener<gardener@tensorflow.org>: Allow TFE_TensorHandleCopyToDevice to have the same device as src and destination. It will reuse the same underlying buffer in those cases. PiperOrigin-RevId: 164909906 --- Commit 13eb3b90e authored by Alexandre Passos<apassos@google.com> Committed by TensorFlower Gardener<gardener@tensorflow.org>: Experimental C and Python APIs to invoke TensorFlow kernels on concrete values. PiperOrigin-RevId: 164902588 --- Commit 7dfabcc01 authored by A. Unique TensorFlower<gardener@tensorflow.org> Committed by TensorFlower Gardener<gardener@tensorflow.org>: Initialize ExecutionOptions in ComputeConstant to default values. PiperOrigin-RevId: 164894867 --- Commit c8897e9bc authored by Benoit Steiner<bsteiner@google.com> Committed by TensorFlower Gardener<gardener@tensorflow.org>: Static required time computation PiperOrigin-RevId: 164894645 --- Commit 076158f9b authored by A. Unique TensorFlower<gardener@tensorflow.org> Committed by TensorFlower Gardener<gardener@tensorflow.org>: Enable implicit->explicit conversion by default. PiperOrigin-RevId: 164890915 --- Commit 58c4a4cb1 authored by A. Unique TensorFlower<gardener@tensorflow.org> Committed by TensorFlower Gardener<gardener@tensorflow.org>: Bugfix: number of input channels is not necessarily in the last dimension, after introduction of data_format param. PiperOrigin-RevId: 164889729 --- Commit 8f9b1af8a authored by Igor Saprykin<isaprykin@google.com> Committed by TensorFlower Gardener<gardener@tensorflow.org>: Recover MonitoredSession when the Coordinator is requested to stop with one of the _PREEMPTION_ERRORS. When SyncReplicasOptimizer is used, a preemption in the Coordinator may result in two cases: Case 1) the session gets silently marked as complete Case 2) the session gets stuck This CL aims to solve and verify solutions for both of these problems. Fix 1 changes the should_stop logic. Fix 2 changes the CoordinatedSession.run() logic. SyncReplicasOptimizer runs a separate set of threads using a Coordinator instance. Those threads do FIFOQueue.enqueue; the main thread does a blocking FIFOQueue.dequeue. `sync_token_q` FIFOQueue is on parameter-servers. When one of the PS instances gets preempted, an AbortedError causes the Coordinator to stop via request_stop(ex). That by itself changes the state of MonitoredSession.should_stop() to True (Fix 1). Results of the blocking Dequeue operation are sent to the chief worker via Recv. What happens next depends on the amount of tokens in `sync_token_q`. If there are enough for the next call to Dequeue to return, then the low-level "tf session run() call" returns. The next iteration of the `while not MonitoredSession.should_stop()` loop decides that the training is complete (Case 1). If there are not enough tokens in `sync_token_q`, then the blocking Dequeue is going to keep waiting for them. This results in the graph execution getting stuck and the whole session getting garbage collected after 10 minutes (Case 2). We decided to fix that by re-creating a session after it gets garbage collected (Fix 2). An alternative was to try to cancel the pending Dequeue operation, but it's not clear that it is the right thing to do and it is also not easy. PiperOrigin-RevId: 164888390 --- Commit 46e4de6e5 authored by A. Unique TensorFlower<gardener@tensorflow.org> Committed by TensorFlower Gardener<gardener@tensorflow.org>: Undo loop fusion changes for now as they seem to be altering a few results. END_PUBLIC RELNOTES: n/a BEGIN_PUBLIC BEGIN_PUBLIC Automated g4 rollback of changelist 164825735 PiperOrigin-RevId: 165340331
* Prepare to remove a bunch of proto.h includes from tensorflow/core headersGravatar Geoffrey Irving2017-06-29
| | | | | | | | | | | | The goal is to make kernels mostly independent of proto headers, which will let us lock down our .so imports. This CL does not remove any actual headers, but changes a bunch of files so that header removal is possible in a followup CL. It also marks the headers that will be removed with // TODO(b/62899350): Remove RELNOTES: n/a PiperOrigin-RevId: 160552878
* Only wait for one non-control input for Merge nodes if there is a loop. This isGravatar A. Unique TensorFlower2017-06-28
| | | | | | | to enable the propagation of shapes for conditionals, which also include Merge nodes. PiperOrigin-RevId: 160417770
* Fix ImportGraphDef() bugGravatar Skye Wanderman-Milne2017-06-09
| | | | | | | | If an input map yields two control inputs of a node being mapped to the same control input, ImportGraphDef() will consolidate the two control inputs into a single incoming edge. The bug was in GraphConstructor::RemapNodeDefInputs(), which would reduce the number of input edges but not make the analogous changes in the input_already_exists vector (which tracks which inputs are remapped). This change also introduces a test case that exposes this bug by causing two control inputs to be consolidated and another control input to be added. In this case, the input_already_exists entry for the added control input actually corresponds to the removed input, and has the wrong value. PiperOrigin-RevId: 158547284
* Automated g4 rollback of changelist 156251356Gravatar Geoffrey Irving2017-05-17
| | | | PiperOrigin-RevId: 156315860
* Automated g4 rollback of changelist 156244933Gravatar Geoffrey Irving2017-05-16
| | | | PiperOrigin-RevId: 156251356
* Reduce direct references to NodeDef in favor of Node and AttrSliceGravatar Geoffrey Irving2017-05-16
| | | | | | | | This is one step towards replacing in-memory use of NodeDef with a customized NodeInfo class. There are still quite a few Node::def() references, but far fewer than before. Those remaining require more work, either because they are part of kernel registration (which is a bunch of functions), copy and modify the NodeDef, etc. Follow-on CLs will remove more. RELNOTES: n/a PiperOrigin-RevId: 156244933
* When using ImportGraphDef with a passed in ShapeRefiner, use theGravatar Vijay Vasudevan2017-04-06
| | | | | | | | | | producer version of the GraphDef when importing; the ShapeRefiner may be initialized with a different graph_def_version, so we need to be able to override it. The test failed without the change to graph_constructor and passes with it. The test uses a legacy graph that is supported (reduction shape). Change: 152459169
* Make ImportGraphDef() work with functions.Gravatar Skye Wanderman-Milne2017-04-04
| | | | | | | | | In addition to modify graph_constructor.cc, this patch adds some other functionality to enable importing fucntions: * Ability to add FunctionDefLibraries to Graphs and FunctionLibraryDefinitions (in addition to existing functions) * FunctionDefsEqual() utility function Change: 152205258
* TF_GraphImportGraphDef bug fix.Gravatar Asim Shankar2017-03-15
| | | | | | | It's okay to import graphs containing deprecated ops. Fixes #8396 Change: 150199261
* Add the graphdef version to InferenceContext and to ShapeRefiner::AddNode.Gravatar A. Unique TensorFlower2017-03-03
| | | | | | | Use this to allow loading reductions saved with older graphdefs. Change GraphConstructor to not increase the version when importing, but instead take the min of all versions. Change: 149152437
* In ShapeRefiner::ExtractConstantSubgraph, don't includeGravatar A. Unique TensorFlower2017-03-03
| | | | | | subgraphs that use a Merge node. Back edges for merges are not on the graph when it is imported by GraphConstructor. Change: 149145899
* Make import_graph_def work with functionsGravatar Skye Wanderman-Milne2017-03-01
| | | | | This patch adds logic for recreating functions originally defined using @Defun and serialized in a GraphDef. Change: 148893654
* Fix code that ignores tensorflow::Status.Gravatar Peter Hawkins2017-02-13
| | | | | Add a new tensorflow::Status::IgnoreError() method to mark call sites where a Status has been intentionally ignored. Change: 147402405
* Add return_tensors parameter to ImportGraphDefOptions. This isGravatar Skye Wanderman-Milne2017-01-17
| | | | | analogous to return_elements in the Python API. Change: 144764659
* Add control_dependencies parameter to ImportGraphDefOptions.Gravatar Skye Wanderman-Milne2017-01-13
| | | | Change: 144457649
* Add input_map parameter to ImportGraphDefOptions.Gravatar Skye Wanderman-Milne2017-01-09
| | | | Change: 143977267
* ImportGraphDef for C++Gravatar Asim Shankar2016-09-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces an ImportGraphDef function in C++ that is parallel to import_graph_def() in the Python API. The intention is for this to be the mechanism to import/enhance a graph in the C-API (with a TF_GraphImportGraphDef function) and be used in all language bindings. There are still two slight differences between the python import_graph_def and ImportGraphDef introduced here that I hope to address in the future. 1. Rebinding of nodes to existing tensors 2. Importing nodes with a different producer op registry With this change, there are 3 ways to convert a GraphDef to a Graph in C++: 1. ConvertGraphDefToGraph() 2. ImportGraphDef() 3. Implicitly via Session::Extend() Each of these have slightly different behavior. However, my understanding of the intention is to: - Make ImportGraphDef be the primary means of conversion - Do away with Session::Extend (and thus with TF_ExtendGraph C-API function) ConvertGraphDefToGraph is used by the runtime. At this point, both ConvertGraphDefToGraph and ImportGraphDef share a bulk of the implementation with minor differences that I think can be done away with. Deferring that unification to a future change. Change: 134014698
* Remove some uses of RE2 library that can be replaced with simplerGravatar Vijay Vasudevan2016-09-21
| | | | | logic. Change: 133908733
* Rectify innocent typosGravatar Asim Shankar2016-09-19
| | | | Change: 133593676
* Update copyright for 3p/tf/core.Gravatar A. Unique TensorFlower2016-06-02
| | | | Change: 123900938
* Replace uses of RE2 with Scanner, for sources that are used on mobile.Gravatar A. Unique TensorFlower2016-03-09
| | | | | | | | | | | This CL also adds the Scanner class to do simple scans over strings, to mimic regexp behavior like [a-zA-Z][a-zA-Z0-9]* with: Scanner scan(s); scan.One(Scanner::LETTER); scan.Any(Scanner::LETTER_DIGIT); bool matched = scan.GetResult(); Change: 116803757
* Remove no-longer-needed RequireDefaultOps().Gravatar Josh Levenberg2016-02-25
| | | | Change: 115511835
* Change GraphDef versions to use version, min_consumer, min_producerGravatar Geoffrey Irving2016-01-26
| | | | | | | | | | | | | | Since all GraphDef versions to date are forwards compatible, we make no attempt to merge old-style and new-style GraphDef version information. The old int32 version field is ignored (and deprecated) and the new VersionDef versions field defaults to producer 0, min_consumer 0 if left out. As a benefit, once this CL is in we can immediately bump the scalar strictness GraphDef version, since consumers will either ignore the new versions (before this CL) or be forward compatible (after this CL). Later, I'll use the same mechanism and protobuf to add versioning to checkpoints. Change: 113091281
* Global search & replace to move to the new location forGravatar Josh Levenberg2016-01-26
| | | | | tensorflow/core/ files and build targets. Change: 113080052
* Move #include <vector> out of port.h to users of std::vector<>.Gravatar Josh Levenberg2016-01-21
| | | | | After this we can replace port.h with types.h. Change: 112727463
* Many tensorflow/core build clean ups.Gravatar Josh Levenberg2016-01-20
| | | | Change: 112523833
* Replacing reference 'names' variable with 'example_names' variable.Gravatar A. Unique TensorFlower2016-01-20
| | | | Change: 112481326
* Added 'logging' import to control_flow_ops which is used in the file but not ↵Gravatar A. Unique TensorFlower2016-01-05
| | | | | | imported. Change: 110842260
* TensorFlow: upstream changes to gitGravatar Vijay Vasudevan2015-12-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change 109366961 TensorFlow BUILD: now that we have an ops library, set linkstatic to 1. This fixes a breakage in the would-be opensource build, and it *might* mean we can get rid of all of the RequireDefaultOps() calls in our code. The ops library is much smaller than the kernels library that was previously linked together. We set linkstatic=0 presumably since we didn't want to package a static copy of the kernels (very large) everywhere. But the op definitions are small, so this seems like a safe change to make. Time to build the various tests was not any longer after this change, and inspecting the example_trainer binary showed no large increase. Change 109363613 TensorFlow: new graph_def_builder_test needs to RequireDefaultOps. Change 109362569 Split ":ops" out of ":kernels" target in tensorflow/core. Change 109360666 Catch dtype and some shape errors sooner in `QueueBase`. Some avoidable errors were not being caught (e.g. the dtypes of the enqueue components were not checked against the queue's dtypes in Python), leading to cryptic messages at runtime. After this CL, they will be caught earlier. Change 109359569 TensorFlow: Expect g_ != nullptr in test Change 109350735 Add a version number to GraphDef We would like to be able to deprecate behavior in newly generated graphs without invalidating tensorflow's ability to read and evaluate old graphs. For this purpose, GraphDef now has a version field which can be checked inside op kernels to determine how backwards compatible to be. version.h defines TF_GRAPHDEF_VERSION_MIN and TF_GRAPHDEF_VERSION_MAX specifying the range of supported GraphDef versions in the current version of tensorflow. Also expose tf.__version__ and tf.__graph_def_version{,_min,_max}__ for Python interrogation purposes. Whenever we want to deprecate or change some GraphDef semantics, we will proceed as follows: 1. Bump TF_GRAPHDEF_VERSION_MAX, leaving TF_GRAPHDEF_VERSION_MIN unchanged. Describe the change in graph.proto, include the date introduced. 2. In each relevant kernel, implement the new behavior if the GraphDef version is new, but preserve the old behavior for previous GraphDef versions. 3. Wait six months or so (we need to formalize this somewhere). 4. Bump TF_GRAPHDEF_VERSION_MIN and remove the backwards compatibility. The GraphDef version is distinct from the open source version, but at least (4) and possibly (1) correspond to major version number bumps. The first GraphDef version bump is the upcoming scalar strictness change, which affects Google users only since open source is already scalar strict. This commit does not yet plumb the version number into OpKernelConstruction so that ops can access it. That will follow. Change 109350260 Made TensorShapeProto implicitly convertible to TensorShape. Base CL: 109366982