deeplearning4j/deeplearning4j

View on GitHub

Showing 13,975 of 13,975 total issues

Method preProcess has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

        op: SameDiffOp,
        sd: SameDiff,
        attributes: Map<String, Any>,
        descriptor: OpNamespace.OpDescriptor,
        outputNames: List<String>,

    Method Op has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    fun NamespaceOps.Op(name: String,
                        extends: Mixin,
                        keepArgs: Boolean = true,
                        keepInputs: Boolean = true,
                        keepOutputs: Boolean = true,

      Method clearExternalAllocations has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @Override
          protected void clearExternalAllocations() {
              if (isDebug.get())
                  log.info("Workspace [{}] device_{} threadId {} guid [{}]: clearing external allocations...", id, Nd4j.getAffinityManager().getDeviceForCurrentThread(), Thread.currentThread().getId(), guid);
      
      

        Method toJava has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                @Override
                public Map toJava(PythonObject pythonObject) {
                    PythonGIL.assertThreadSafe();
                    HashMap ret = new HashMap();
                    PyObject dictType = new PyObject(PyDict_Type());

          Method init has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @Override
              protected void init() {
                  if (workspaceConfiguration.getPolicyLocation() == LocationPolicy.MMAP) {
                      throw new ND4JIllegalStateException("CUDA do not support MMAP workspaces yet");
                  }

            Method callWithArgsAndKwargs has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public PythonObject callWithArgsAndKwargs(List args, Map kwargs) {
                    PythonGIL.assertThreadSafe();
                    try (PythonGC gc = PythonGC.watch()) {
                        if (!Python.callable(this)) {
                            throw new PythonException("Object is not callable: " + toString());

              Method analyze has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public void analyze() throws Exception {
                          Map<String,WorkspaceSeries> workspaceMemory = new ConcurrentHashMap<>();
                          RuntimeSeries runtimeSeries = new RuntimeSeries();
                          NumberAxis timeAxis = new NumberAxis();
              
              

                Method hgemm has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    @Override
                    protected void hgemm(char Order, char TransA, char TransB, int M, int N, int K, float alpha, INDArray A, int lda,
                                    INDArray B, int ldb, float beta, INDArray C, int ldc) {
                        //A = Shape.toOffsetZero(A);
                        //B = Shape.toOffsetZero(B);

                  Method allocate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      @Override
                      public Pointer allocate(long bytes, MemoryKind kind, boolean initialize) {
                          val allocator = AtomicAllocator.getInstance();
                  
                          //log.info("Allocating {} bytes in {} memory...", bytes, kind);

                    Method broadcast has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public synchronized void broadcast(INDArray array) {
                            if (array == null)
                                return;
                    
                            Preconditions.checkArgument(!array.isView() || array.elementWiseStride() != 1, "View can't be used in DeviceLocalNDArray");

                      Method update has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public synchronized void update(@NonNull INDArray array) {
                              Preconditions.checkArgument(!array.isView() || array.elementWiseStride() != 1, "View can't be used in DeviceLocalNDArray");
                      
                              val numDevices = Nd4j.getAffinityManager().getNumberOfDevices();
                              val device = Nd4j.getAffinityManager().getDeviceForCurrentThread();

                        Method validateNpzFile has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public static ValidationResult validateNpzFile(@NonNull File f) {
                                ValidationResult vr = Nd4jCommonValidator.isValidFile(f, "Numpy .npz File", false);
                                if (vr != null && !vr.isValid())
                                    return vr;
                        
                        

                          Method eventFromLine has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public static LogEvent eventFromLine(String line) {
                                  String[] split = line.split(",");
                                  LogEventBuilder builder = LogEvent.builder();
                                  builder
                                          .eventTimeMs(Long.parseLong(split[0]))

                            Method calculateOutputShape has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                @Override
                                public List<LongShapeDescriptor> calculateOutputShape(OpContext oc) {
                                    val descriptor = getDescriptor();
                                    if (outputShapes != null && !outputShapes.isEmpty())
                                        return outputShapes;

                              Method profilingConfigurableHookIn has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public long profilingConfigurableHookIn(CustomOp op, OpContext oc) {
                                      List<INDArray> inArgs = oc != null ? oc.getInputArrays() : op.inputArguments();
                                      List<INDArray> outArgs = oc != null ? oc.getOutputArrays() : op.outputArguments();
                                      Nd4j.getDeallocatorService().toggleDeallocationBlock(true);
                                      if(isDebug() && isVerbose()) {

                                Method outputVariables has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    @Override
                                    public SDVariable[] outputVariables(String baseName) {
                                        if(zVertexId == null)  {
                                            val outputNames = sameDiff.getOutputsForOp(this);
                                            //no need to dynamically create if already exists

                                  Method leverage has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      @Override
                                      public INDArray leverage() {
                                          WorkspaceUtils.assertValidArray(this, "Cannot leverage INDArray to new workspace");
                                          if (!isAttached())
                                              return this;

                                    Method configureWithSameDiff has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        @Override
                                        public void configureWithSameDiff(SameDiff sameDiff) {
                                            this.sameDiff = sameDiff;
                                            String[] inputsForOp = sameDiff.getInputsForOp(this);
                                            LSTMLayerWeights.LSTMLayerWeightsBuilder builder = LSTMLayerWeights.builder();

                                      Method resolveNegativeShapeIfNeccessary has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public static int[] resolveNegativeShapeIfNeccessary(int[] newShape,int[] shape) {
                                              int numberNegativesOnes = 0;
                                              for (int i = 0; i < shape.length; i++) {
                                                  if (shape[i] < 0) {
                                                      if (numberNegativesOnes >= 1)

                                        Method getMatrixMultiplyShape has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public static int[] getMatrixMultiplyShape(int[] left, int[] right) {
                                                if(Shape.shapeIsScalar(left)) {
                                                    return right;
                                                }
                                        
                                        
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language