History log of /external/tensorflow/tensorflow/compiler/xla/packed_literal_reader.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
7d64e124103c8334b7d8b127cd2eff786959d185 06-Jan-2018 Mark Heffernan <meheff@google.com> Remove protobuf-compatibility methods from the Literal class.

This CL primarily does two things:

(1) Remove the protobuf-compatibility methods (eg, mutable_f32s()) from Literal. These were added to Literal as part of the migration of Literal from a proto to a c++ class. Now that Literal is a proper class, these protobuf methods make it difficult to enforce invariants and expose too much of the class' implementation details.

(2) Make shape an immutable property of Literals, and make shape and the data members holding the Literal data coherent by construction. Previously, the shape could be set arbitrarily, and the data members such as f32_ could be arbitrarily sized irrespective of the shape of the literal.

The remainder of the CL mostly deals with the fallout. Notable other changes:

- Literal is no longer a recursive data structure. To avoid copies when passing a subliteral of a tuple-shaped Literal, a LiteralView class is added which provides a read-only view of an arbitrary subliteral.

- Tuple-shaped Literals can no longer be built up incrementally so to avoid copying Literal values during construction, the following methods with move semantics are added: Literal::MoveFrom and Literal::MoveIntoTuple. These methods transfer ownership the underlying buffers enabling, for example, a literal to be moved into an element of a tuple-shaped literal with no data copying.

- Replace the internal data structure holding the actual data from a bunch of std::vectors (eg, s32s_, f32s, etc) to a single ShapeTree<char*>. This significantly simplifies accessors and makes improved support of tuple-shaped literals much easier (eg, Literal::Get<>() can now access elements in arbitrary subliterals).

Also, Literal is made movable, but not copyable. Otherwise, it is all too easy to accidentally introduce expensive copies of Literals. Literal::Clone is added to handle the case where a copy is needed (Literal::CloneToUnique already exists).

PiperOrigin-RevId: 181014890
/external/tensorflow/tensorflow/compiler/xla/packed_literal_reader.cc
5478d53adf4e7af05449cae92fd4f7146caa3ccf 21-Jun-2017 A. Unique TensorFlower <gardener@tensorflow.org> Remove redundant `get` calls on smart pointers

PiperOrigin-RevId: 159675809
/external/tensorflow/tensorflow/compiler/xla/packed_literal_reader.cc
46737e4e81314f7482bfd6a710f126a27f5d7975 19-Jun-2017 A. Unique TensorFlower <gardener@tensorflow.org> Remove class xla::LiteralUtil. NFC (mind-numbingly so).

This patch removes class xla::LiteralUtil and rewrites every call to use class
xla::Literal instead.
PiperOrigin-RevId: 159446373
/external/tensorflow/tensorflow/compiler/xla/packed_literal_reader.cc
02ac85399d4fb35d5055ecf426632b9446a70041 01-Jun-2017 A. Unique TensorFlower <gardener@tensorflow.org> Introduce new class Literal to replace protobuf Literal.

This renames the existing Literal message to LiteralProto and introduces a new
C++ class named Literal to replace it.

The LiteralProto is only used at RPC boundaries, or when protobuf-specific
functionality is required. The Literal class offers a 'ToProto' function to
generate a new LiteralProto message when necessary.

Currently, all the static functions in class LiteralUtil, just forward to their
counterparts in class Literal. This will change in a future CL.

Class Literal implements all the buffers as std::vectors. The only exception
is preds(), which given the std::vector<bool> representation, makes it unusable
for the semantics we require (it's not possible to get the address of the
underlying vector, for instance).

The CL adds a BoolVector class to work around that issue.

In future CLs, the std::vector representation may be changed to something more
efficient, if needed.

PiperOrigin-RevId: 157739125
/external/tensorflow/tensorflow/compiler/xla/packed_literal_reader.cc
1e67c90e2caceeff82d09793d1ef5fa0300d219b 09-Jan-2017 Peter Hawkins <phawkins@google.com> Initial open-source release of XLA: Accelerated Linear Algebra.

XLA is a compiler-based linear algebra execution engine that targets CPUs, GPUs and custom accelerators.

XLA is still experimental; we are releasing it early to get the community involved.
Change: 143990941
/external/tensorflow/tensorflow/compiler/xla/packed_literal_reader.cc