tensorflow/python/framework/ops_test.py
File ops_test.py
has 3024 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# 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
OperationTest
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class OperationTest(test_util.TensorFlowTestCase):
def testTraceback(self):
g = ops.Graph()
op1 = ops.Operation.from_node_def(
TensorAndShapeTest
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class TensorAndShapeTest(test_util.TensorFlowTestCase):
def testShape(self):
op = ops.Operation.from_node_def(
ops._NodeDef("FloatOutput", "myop"), ops.Graph(), [], [dtypes.float32]
Function test_add_to_collection
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def test_add_to_collection(self):
g = ops.Graph()
g.add_to_collection("key", 12)
g.add_to_collection("other", "foo")
g.add_to_collection("key", 34)
Avoid deeply nested control flow statements. Open
Open
with g.device(pydev.merge_device(None)):
g.create_op("FloatOutput", [], [dtypes.float32])
Avoid deeply nested control flow statements. Open
Open
with g.control_dependencies([a_4]):
# deps [a_3, a_4]
b_3_4 = _apply_op(g, "FloatOutput", [], [dtypes.float32])
# deps = [a_3]
b_3 = _apply_op(g, "FloatOutput", [], [dtypes.float32])
Avoid deeply nested control flow statements. Open
Open
with g.control_dependencies([a_3]):
with g.control_dependencies([a_4]):
# deps [a_3, a_4]
b_3_4 = _apply_op(g, "FloatOutput", [], [dtypes.float32])
# deps = [a_3]
Avoid deeply nested control flow statements. Open
Open
with g.device(""):
g.create_op("FloatOutput", [], [dtypes.float32])
Avoid deeply nested control flow statements. Open
Open
with g3.as_default():
with ops.init_scope():
# This op should be lifted into g3, because g3 is not building a
# function.
_ = constant_op.constant(1.0)