tensorflow/python/ops/resource_variable_ops.py
File resource_variable_ops.py
has 2278 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# Copyright 2016 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
Function __init__
has 23 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__( # pylint: disable=super-init-not-called
Function __init__
has 19 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Function _init_from_args
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _init_from_args(
Function __init__
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__( # pylint: disable=super-init-not-called
Function _strided_slice_assign
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _strided_slice_assign(self, begin, end, strides, value, name, begin_mask,
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, handle, dtype, shape, in_graph_mode, parent_op, unique_id):
Function _variable_handle_from_shape_and_dtype
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _variable_handle_from_shape_and_dtype(shape,
Function eager_safe_variable_handle
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def eager_safe_variable_handle(initial_value, shape, shared_name, name,
Function assign
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def assign(self, value, use_locking=None, name=None, read_value=True):
Function _export_to_saved_model_graph
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _export_to_saved_model_graph(self, object_map=None, tensor_map=None,
Function assign
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def assign(self, value, use_locking=None, name=None, read_value=True):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, shape, dtype=dtypes.float32, trainable=True,
Function _init_from_handle
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _init_from_handle(self,
Function assign_sub
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def assign_sub(self, delta, use_locking=None, name=None, read_value=True):
Function assign_add
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def assign_add(self, delta, use_locking=None, name=None, read_value=True):
Function assign_add
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def assign_add(self, delta, use_locking=None, name=None, read_value=True):
Function assign_sub
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def assign_sub(self, delta, use_locking=None, name=None, read_value=True):
Function _combine_handle_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def _combine_handle_data(handle, initial_value):
"""Concats HandleData from tensors `handle` and `initial_value`.
Args:
handle: A `Tensor` of dtype `resource`.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"