tensorflow/python/ops/math_ops.py
File math_ops.py
has 4447 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
Function matmul
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def matmul(
Function count_nonzero
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def count_nonzero(input_tensor=None,
Function matvec
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def matvec(a,
Function sparse_segment_sqrt_n_v2
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def sparse_segment_sqrt_n_v2(
Function sparse_segment_sqrt_n
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def sparse_segment_sqrt_n(
Function sparse_segment_mean
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def sparse_segment_mean(
Function reduce_any_v1
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def reduce_any_v1(input_tensor,
Function sparse_segment_sum
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def sparse_segment_sum(
Function reduce_prod_v1
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def reduce_prod_v1(input_tensor,
Function reduce_logsumexp_v1
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def reduce_logsumexp_v1(input_tensor,
Function sparse_segment_mean_v2
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def sparse_segment_mean_v2(
Function reduce_sum_v1
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def reduce_sum_v1(input_tensor,
Function reduce_min_v1
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def reduce_min_v1(input_tensor,
Function sparse_segment_sum_v2
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def sparse_segment_sum_v2(
Function reduce_all_v1
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def reduce_all_v1(input_tensor,
Function count_nonzero_v2
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def count_nonzero_v2(
Function reduce_mean_v1
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def reduce_mean_v1(input_tensor,
Function reduce_max_v1
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def reduce_max_v1(input_tensor,
Function argmax
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def argmax(input,
Function linspace_nd
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def linspace_nd(start, stop, num, name=None, axis=0):
Function reduce_max_with_dims
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def reduce_max_with_dims(input_tensor,
Function sobol_sample
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def sobol_sample(dim, num_results, skip=0, dtype=dtypes.float32, name=None):
Function argmin
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def argmin(input,
Function range
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def range(start, limit=None, delta=1, dtype=None, name="range"): # pylint: disable=redefined-builtin
Function cumsum
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def cumsum(x, axis=0, exclusive=False, reverse=False, name=None):
Function cumulative_logsumexp
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def cumulative_logsumexp(x, axis=0, exclusive=False, reverse=False, name=None):
Function reduce_sum_with_dims
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def reduce_sum_with_dims(input_tensor,
Function cumprod
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def cumprod(x, axis=0, exclusive=False, reverse=False, name=None):
Function divide
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def divide(x, y, name=None):
"""Computes Python style division of `x` by `y`.
For example:
- 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"