Skip to content

Commit

Permalink
Running our linter on a lot of files.
Browse files Browse the repository at this point in the history
Change: 112920860
  • Loading branch information
Vijay Vasudevan committed Jan 25, 2016
1 parent 87af568 commit 9b70316
Show file tree
Hide file tree
Showing 148 changed files with 948 additions and 474 deletions.
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ new_http_archive(

new_http_archive(
name = "eigen_archive",
url = "https://bitbucket.org/eigen/eigen/get/fb2fa05.tar.gz",
sha256 = "8aacd8065d52528af1a22d6b72925dbb6b9fb8f25e46769481dd06d3edf63bbd",
url = "https://bitbucket.org/eigen/eigen/get/c8e5d09.tar.gz",
sha256 = "be61d1ce686e950d9a3a61b2aa83562ba4582ce1813e475869146e0a05915857",
build_file = "eigen.BUILD",
)

Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ while true; do
done

cat > third_party/gpus/cuda/cuda.config <<EOF
# CUDA_TOOLKIT_PATH refers to the CUDA toolkit. Tensorflow requries Cuda 7.0
# CUDA_TOOLKIT_PATH refers to the CUDA toolkit. Tensorflow requires Cuda 7.0
# at the moment.
CUDA_TOOLKIT_PATH="$CUDA_TOOLKIT_PATH"
Expand Down
2 changes: 1 addition & 1 deletion eigen.BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package(default_visibility = ["//visibility:public"])

archive_dir = "eigen-eigen-fb2fa0527077"
archive_dir = "eigen-eigen-c8e5d094f3a9"

cc_library(
name = "eigen",
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/cc/ops/cc_op_gen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void WriteCCOp(const OpDef& op_def, WritableFile* h, WritableFile* cc) {
R"comment( .WithName(StringPiece): Set the Node's name
.WithDevice(StringPiece): Set the Node's requested device
.WithControlInput(Node*) / .WithControlInputs({Node*, ...}):
Add control depencies on the specified Node(s).
Add control dependencies on the specified Node(s).
Returns a pointer to the created Node)comment");

Expand Down
4 changes: 2 additions & 2 deletions tensorflow/core/common_runtime/direct_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ string GetRendezvousKey(const string& tensor_name,
//
// 2) Recv nodes always complete immediately: The inputs are sent into
// the local rendezvous before we start the executor, so the
// corresonding recvs will not block.
// corresponding recvs will not block.
//
// Based on these assumptions, we can use the same thread pool for
// both "non-blocking" and "blocking" OpKernels on Android.
Expand Down Expand Up @@ -543,7 +543,7 @@ Status DirectSession::CreateGraphs(
}
}

for (auto partition : partitions) {
for (auto&& partition : partitions) {
const string& partition_name = partition.first;

GraphDef* graph_def = &partition.second;
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/common_runtime/direct_session_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ TEST_F(DirectSessionMinusAXTest, RunSimpleNetwork) {
ASSERT_OK(s);

ASSERT_EQ(1, outputs.size());
// The first output should be initiailzed and have the correct
// The first output should be initialized and have the correct
// output.
auto mat = outputs[0].matrix<float>();
ASSERT_TRUE(outputs[0].IsInitialized());
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/common_runtime/executor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ Status ExecutorImpl::InferAllocAttr(
return s;
}

// The state associated with one invokation of ExecutorImpl::Run.
// The state associated with one invocation of ExecutorImpl::Run.
// ExecutorState dispatches nodes when they become ready and keeps
// track of how many predecessors of a node have not done (pending_).
class ExecutorState {
Expand Down
4 changes: 2 additions & 2 deletions tensorflow/core/common_runtime/function.cc
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ Status FunctionLibraryRuntimeImpl::InstantiateSymbolicGradient(
const auto& func = f->func();
const FunctionDef* fdef = lib_def_->Find(func.name());
if (fdef == nullptr) {
// f is a primitve op.
// f is a primitive op.
gradient::Creator creator;
TF_RETURN_IF_ERROR(gradient::GetOpGradientCreator(func.name(), &creator));
if (creator == nullptr) {
Expand Down Expand Up @@ -1169,7 +1169,7 @@ class SymbolicGradientHelper {

// 'ready' keeps track of nodes that have been completely
// backpropped. Initially, for every output y of the function f, we
// add dy as an input of the the gradient function.
// add dy as an input of the gradient function.
std::deque<Node*> ready_;

// Makes a copy of fbody_ in gbody_.
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/common_runtime/function.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ bool RemoveListArrayConverter(Graph* g);
// multiple times by calling ExpandInlineFunctions a few times.
bool ExpandInlineFunctions(FunctionLibraryRuntime* lib, Graph* graph);

// Applies graph rewrite optimzation such as inlining, dead code
// Applies graph rewrite optimization such as inlining, dead code
// removal, etc.
//
// **g is a graph constructed based on the runtime library 'lib'.
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/common_runtime/gpu/gpu_allocator_retry.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class GPUAllocatorRetry {
// then wait up to 'max_millis_to_wait' milliseconds, retrying each
// time a call to DeallocateRaw() is detected, until either a good
// pointer is returned or the deadline is exhausted. If the
// deadline is exahusted, try one more time with 'verbose_failure'
// deadline is exhausted, try one more time with 'verbose_failure'
// set to true. The value returned is either the first good pointer
// obtained from 'alloc_func' or nullptr.
void* AllocateRaw(std::function<void*(size_t alignment, size_t num_bytes,
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ void GPUBFCAllocator::DumpMemoryLog(size_t num_bytes) {
}
}

// Next show the the chunks that are in use, and also summarize their
// Next show the chunks that are in use, and also summarize their
// number by size.
std::map<size_t, int> in_use_by_size;
for (auto& it : ptr_to_chunk_map_) {
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/common_runtime/gpu/gpu_event_mgr_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ TEST(EventMgr, StreamSwitchingFlushesImmediately) {
EXPECT_GT(initial_live_bytes, live_tensor_bytes);
}

TEST(EventMgr, ManySmallTensorsSeperateCallsFlushed) {
TEST(EventMgr, ManySmallTensorsSeparateCallsFlushed) {
auto stream_exec = GPUMachineManager()->ExecutorForDevice(0).ValueOrDie();
EventMgr em(stream_exec, GPUOptions());
TEST_EventMgrHelper th(&em);
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/common_runtime/gpu/gpu_region_allocator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ void GPURegionAllocator::CheckForMemoryLeaks() {
}

// Since there's no merging of chunks once allocated, we want to
// maximize their reusablity (which argues for fewer, larger sizes),
// maximize their reusability (which argues for fewer, larger sizes),
// while minimizing waste (which argues for tight-fitting sizes).
//
// The smallest unit of allocation is 256 bytes.
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/common_runtime/gpu/gpu_stream_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Status AssignStreams(const Graph* graph, const AssignStreamsOpts& opts,
}
}
}
// We perform stream assigmnent assuming a large number of
// We perform stream assignment assuming a large number of
// stream IDs and then map these down to the required number of streams
// using simple round-robin.
// Stream Assignment strategy:
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/common_runtime/gpu/gpu_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class GPUUtil {
// "tensor" is GPU-local. "dev" is the hosting GPU.
// "device_context" should be the context of the GPU "_Send" op
// which provides the Tensor.
// Sets all necessasry fields of "proto" by transferring value
// Sets all necessary fields of "proto" by transferring value
// bytes from GPU to CPU RAM. "is_dead" indicates that the
// tensor is dead with an uninit value.
static void SetProtoFromGPU(const Tensor& tensor, Device* dev,
Expand Down
4 changes: 2 additions & 2 deletions tensorflow/core/common_runtime/gpu/pool_allocator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ PoolAllocator::PoolAllocator(size_t pool_size_limit, bool auto_resize,
PoolAllocator::~PoolAllocator() { Clear(); }

namespace {
// Pools contain Chunks allocatated from the underlying Allocator.
// Pools contain Chunks allocated from the underlying Allocator.
// Chunk alignment is always on kPoolAlignment boundaries. Each Chunk
// begins with a descriptor (ChunkPrefix) that gives its size and a
// pointer to itself. The pointer returned to the user is just past
Expand All @@ -56,7 +56,7 @@ namespace {
// pointer and also re-write the ChunkPrefix.chunk_ptr value
// immediately before it. This way the Chunk address and size can be
// recovered from the returned user pointer, regardless of alignment.
// Note that this deferencing of the pointers means that we cannot
// Note that this dereferencing of the pointers means that we cannot
// handle GPU memory, only CPU memory.
struct ChunkPrefix {
size_t num_bytes;
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/common_runtime/gpu/process_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const bool FLAGS_brain_gpu_region_allocator_reset_to_nan = false;
const bool FLAGS_brain_gpu_use_bfc_allocator = true;

// If true, record attributes of memory allocations and
// dyanmically check for appropriate use of registered memory.
// dynamically check for appropriate use of registered memory.
// Should only be true for debugging or diagnosis of
// performance issues.
bool FLAGS_brain_gpu_record_mem_types = false;
Expand Down
6 changes: 3 additions & 3 deletions tensorflow/core/common_runtime/gpu/process_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ProcessState {
MemDesc PtrType(const void* ptr);

// Returns the one CPUAllocator used for the given numa_node.
// TEMPORY: ignores numa_node.
// TEMPORARY: ignores numa_node.
Allocator* GetCPUAllocator(int numa_node);

// Returns the one GPU allocator used for the indexed GPU.
Expand All @@ -80,7 +80,7 @@ class ProcessState {
// used on that first call is used.
//
// "Allocator type" describes the type of algorithm to use for the
// underlying allocator. REQURES: Must be a valid type (see
// underlying allocator. REQUIRES: Must be a valid type (see
// config.proto for the list of supported strings.).
//
// REQUIRES: gpu_id must be a valid ordinal for a GPU available in the
Expand All @@ -98,7 +98,7 @@ class ProcessState {
// interface to be used for network device memory registration.
// "bus_id" is platform-specific. On many platforms it
// should be 0. On machines with multiple PCIe buses, it should be
// the index of one of the PCIe buses. If the the bus_id is invalid,
// the index of one of the PCIe buses. If the bus_id is invalid,
// results are undefined.
typedef std::function<void(void*, size_t)> AllocVisitor;
void AddGPUAllocVisitor(int bus_id, AllocVisitor visitor);
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/common_runtime/kernel_benchmark_testlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ limitations under the License.
namespace tensorflow {

class Device;
class SessionOptions;
struct SessionOptions;

namespace test {

Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/common_runtime/local_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ limitations under the License.

namespace tensorflow {

class SessionOptions;
struct SessionOptions;

// This class is shared by ThreadPoolDevice and GPUDevice and
// initializes a shared Eigen compute device used by both. This
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/common_runtime/session_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ limitations under the License.
namespace tensorflow {

class Session;
class SessionOptions;
struct SessionOptions;

class SessionFactory {
public:
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/common_runtime/simple_placer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace {
// types in 'supported_device_types' and returns the *first* subset of devices
// that match.
//
// For example, if suported_device_types contains {GPU, CPU} and
// For example, if supported_device_types contains {GPU, CPU} and
// 'devices' contains CPU and GPU devices, the returned vector will
// include *only* GPU devices, since that is higher in the priority
// order in 'supported_device_types'.
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/framework/attr_value_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ string SummarizeAttrValue(const AttrValue& attr_value);
// Generates an error if attr_value doesn't have the indicated attr type.
Status AttrValueHasType(const AttrValue& attr_value, StringPiece type);

// Converts a text proto value from "text" into the the field of *out
// Converts a text proto value from "text" into the field of *out
// indicated by "type" (e.g. from the type field of an AttrDef).
// Examples:
// * If type:"int" and text:"-14", then *out is set to "i: -14"
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/framework/function.proto
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ message FunctionDef {
// 'attr' maps names defined by 'func's attr defs to attr values.
// attr values may have placeholders which are substituted
// recursively by concrete values when this node is instantiated.
// These placeholdes must name an attr listed in the FunctionDef's
// These placeholders must name an attr listed in the FunctionDef's
// signature.
map<string, AttrValue> attr = 5;
}
Expand Down
4 changes: 2 additions & 2 deletions tensorflow/core/framework/function_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ REGISTER_OP("Cond")
output = Cond(input) ? then_branch(input) : else_branch(input)
cond: A function takes 'input' and returns a scalar.
then_branch: A funcion takes 'input' and returns 'output'.
else_branch: A funcion takes 'input' and returns 'output'.
then_branch: A function takes 'input' and returns 'output'.
else_branch: A function takes 'input' and returns 'output'.
)doc");

TEST(TFunc, Body_Array_List_Converter) {
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/framework/node_def_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Status ValidateNodeDef(const NodeDef& node_def, const OpDef& op_def);

// Computes the mapping from input/output argument name to the
// corresponding input/output index range. For example,
// input "foo" coresponds to input indices
// input "foo" corresponds to input indices
// [ (*inputs)["foo"].first, (*inputs)["foo"].second ).
typedef std::unordered_map<string, std::pair<int, int>> NameRangeMap;
Status NameRangesForNode(const NodeDef& node_def, const OpDef& op_def,
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/framework/op.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class OpRegistry : public OpRegistryInterface {
const OpDef* LookUp(const string& op_type_name,
Status* status) const override;

// Fills *ops with all registered OpDefss (except those with names
// Fills *ops with all registered OpDefs (except those with names
// starting with '_' if include_internal == false).
void Export(bool include_internal, OpList* ops) const;

Expand Down
6 changes: 3 additions & 3 deletions tensorflow/core/framework/op_compatibility_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class OpCompatibilityTest : public OpsTestBase {
ASSERT_OK(InOutTypesForNode(*node_def(), old_op_def, &old_in_types,
&old_out_types));

// This should be all that is needed to get compatiblity.
// This should be all that is needed to get compatibility.
const OpDef* new_op_def = RegisteredOpDef();
AddDefaultsToNodeDef(*new_op_def, node_def());

Expand Down Expand Up @@ -93,7 +93,7 @@ class OpCompatibilityTest : public OpsTestBase {
ASSERT_OK(InOutTypesForNode(*node_def(), old_op_def, &old_in_types,
&old_out_types));

// This should be all that is needed to get compatiblity.
// This should be all that is needed to get compatibility.
const OpDef* new_op_def = RegisteredOpDef();
AddDefaultsToNodeDef(*new_op_def, node_def());

Expand All @@ -117,7 +117,7 @@ class OpCompatibilityTest : public OpsTestBase {
ASSERT_OK(InOutTypesForNode(*node_def(), old_op_def, &old_in_types,
&old_out_types));

// This should be all that is needed to get compatiblity.
// This should be all that is needed to get compatibility.
const OpDef* new_op_def = RegisteredOpDef();
AddDefaultsToNodeDef(*new_op_def, node_def());

Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/framework/op_def_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class OpDefBuilder {
// Perhaps by linking the type of the tensor to a type attr?
OpDefBuilder& Attr(StringPiece spec);

// Adds an input or ouput to this OpDefBuilder (and returns *this).
// Adds an input or output to this OpDefBuilder (and returns *this).
// The spec has form "<name>:<type-expr>" or "<name>:Ref(<type-expr>)"
// where <name> matches regexp [a-z][a-z0-9_]* and <type-expr> can be:
// * For a single tensor: <type>
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/framework/op_kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ class OpKernelContext {
Status mutable_input(const string& name, Tensor* tensor, bool lock_held);

// Returns the named list-valued mutable input in "list", as defined
// in the OpDef. If the named intput is not list-valued, returns a
// in the OpDef. If the named input is not list-valued, returns a
// one-element list. Must be used to access Ref inputs. The values
// stored in the Tensor buffer may be modified, and modifications
// will be visible to other Ops reading the same ref tensor.
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/framework/reader_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ReaderInterface : public ResourceBase {
public:
// Read a single record into *key / *value. May get more work from
// *queue if the current work is complete. Sets the status on
// *context with an OutOfRange Status if the the current work is
// *context with an OutOfRange Status if the current work is
// complete and the queue is done (closed and empty).
// This method may block.
virtual void Read(QueueInterface* queue, string* key, string* value,
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/framework/rendezvous.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Rendezvous : public core::RefCounted {
AllocatorAttributes alloc_attrs;
};

// Constructs a rendezvouz key for the tensor of "name" sent from
// Constructs a rendezvous key for the tensor of "name" sent from
// "src_device" to "dst_device". The tensor is generated in the frame
// and iteration specified by "frame_iter".
static string CreateKey(const string& src_device, uint64 src_incarnation,
Expand Down
4 changes: 2 additions & 2 deletions tensorflow/core/framework/tensor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ message TensorProto {
// to represent a constant Tensor with a single value.
int32 version_number = 3;

// Serialized content from TensorBase::Serialize() This representation can be
// used for all tensor types.
// Serialized content from Tensor::AsProtoTensorContent(). This representation
// can be used for all tensor types.
bytes tensor_content = 4;

// Type specific representations that make it easy to create tensor protos in
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/framework/tensor_slice.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class TensorSlice {
// -- from just a dimension (in this case it will create a full slice)
// -- from an array of pairs of integers.
// -- from a TensorSliceProto protocol buffer
// -- from a string format of "start,lenth:start,length..." where each
// -- from a string format of "start,length:start,length..." where each
// "start,length" pair represents the slice on one dimension. We allow a
// special "-" that means "everything for this dimension". One such example
// is: 0,10:-:14,1:-:-
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/framework/tensor_testutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ template <typename T>
void ExpectTensorEqual(const Tensor& x, const Tensor& y);

// Expects "x" and "y" are tensors of the same type, same shape, and
// approxmiate equal values, each within "abs_err".
// approximate equal values, each within "abs_err".
template <typename T>
void ExpectTensorNear(const Tensor& x, const Tensor& y, const T& abs_err);

Expand Down
Loading

0 comments on commit 9b70316

Please sign in to comment.