deeplearning4j/deeplearning4j

View on GitHub

Showing 6,111 of 13,975 total issues

Method importInfoForEachNodeInGraph has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    fun <GRAPH_TYPE: GeneratedMessageV3,
            NODE_TYPE: GeneratedMessageV3,
            OP_DEF_TYPE: GeneratedMessageV3,
            TENSOR_TYPE: GeneratedMessageV3,
            ATTRIBUTE_TYPE: GeneratedMessageV3,

    Method createSignature has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static MethodSpec createSignature(Model model) {
            MethodSpec.Builder c = MethodSpec.methodBuilder(model.modelName())
                    .addModifiers(Modifier.PUBLIC)
                    .addException(Exception.class)
                    .addJavadoc(model.documentation());

      Method clearPinnedAllocations has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @Override
          protected void clearPinnedAllocations(boolean extended) {
              if (isDebug.get())
                  log.info("Workspace [{}] device_{} threadId {} cycle {}: clearing pinned allocations...", id, Nd4j.getAffinityManager().getDeviceForCurrentThread(), Thread.currentThread().getId(), cyclesCount.get());
      
      

        Method deallocate has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @Override
            public void deallocate() {
                log.trace("Deallocating CUDA workspace");
        
                // purging workspace planes

          Method create has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @Override
              public DataBuffer create(DataBuffer underlyingBuffer, long offset, long length) {
                  switch (underlyingBuffer.dataType()) {
                      case DOUBLE:
                          return new CudaDoubleDataBuffer(underlyingBuffer, length, offset);

            Method create has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                @Override
                public DataBuffer create(ByteBuffer underlyingBuffer, DataType dataType, long length, long offset) {
                    switch (dataType) {
                        case DOUBLE:
                            return new CudaDoubleDataBuffer(underlyingBuffer, dataType, length, offset);

              Method create has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  @Override
                  public DataBuffer create(DataType dataType, long length, boolean initialize) {
                      switch (dataType) {
                          case UINT16:
                              return new CudaUInt16DataBuffer(length, initialize);

                Method create has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    @Override
                    public DataBuffer create(DataType dataType, long length, boolean initialize, MemoryWorkspace workspace) {
                        if (workspace == null)
                            return create(dataType, length, initialize);
                
                

                  Method create has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      @Override
                      public DataBuffer create(ByteBuffer underlyingBuffer, DataType dataType, long length, long offset) {
                          switch (dataType) {
                              case DOUBLE:
                                  return new DoubleBuffer(underlyingBuffer, dataType, length, offset);

                    Method create has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        @Override
                        public DataBuffer create(@NonNull DataType dataType, long length, boolean initialize) {
                            switch (dataType) {
                                case DOUBLE:
                                    return new DoubleBuffer(length, initialize);

                      Method createBlas has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          @Override
                          public void createBlas() {
                              // we'll check hardware support first
                              if (!nativeOps.isMinimalRequirementsMet()) {
                                  // this means cpu binary was built for some arch support, we don't have on this box

                        Method getInt has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            @Override
                            public int getInt(long i) {
                                if (released)
                                    throw new IllegalStateException("You can't use DataBuffer once it was released");
                        
                        

                          Method getFloat has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              @Override
                              public float getFloat(long i) {
                                  if (released)
                                      throw new IllegalStateException("You can't use DataBuffer once it was released");
                          
                          

                            Method getLong has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                @Override
                                public long getLong(long i) {
                                    if (released)
                                        throw new IllegalStateException("You can't use DataBuffer once it was released");
                            
                            

                              Method pca_factor has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public static INDArray pca_factor(INDArray A, double variance, boolean normalize) {
                                      A = A.dup();
                                      if (normalize) {
                                          // Normalize to mean 0 for each feature ( each column has 0 mean )
                                          INDArray mean = A.mean(0);

                                Method convertToDataType has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public static DataType convertToDataType(org.tensorflow.framework.DataType dataType) {
                                        switch (dataType) {
                                            case DT_UINT16:
                                                return DataType.UINT16;
                                            case DT_UINT32:

                                  Method toPlaceholderMap has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      private Map<String, INDArray> toPlaceholderMap(MultiDataSet ds) {
                                          Map<String, INDArray> placeholders = new HashMap<>();
                                          int count = 0;
                                          for (String s : trainingConfig.getDataSetFeatureMapping()) {
                                              placeholders.put(s, ds.getFeatures(count++));

                                    Method directExecHelper has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        protected ExecutionResult directExecHelper(Map<String, INDArray> placeholders,
                                                                                   Map<String, SDValue> otherPlaceHolders,
                                                                                   At at, MultiDataSet batch,
                                                                                   Collection<String> requiredActivations,
                                                                                   List<Listener> activeListeners,

                                      Method outputs has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public List<SDVariable> outputs(){
                                              //Outputs: the SDVariables of the root OR child nodes that are not consumed *ONLY* by another op within the subgraph
                                              List<SDVariable> allOutputs = new ArrayList<>();
                                              if(rootNode.outputVariables() != null)
                                                  Collections.addAll(allOutputs, rootNode.outputVariables());

                                        Method getDataTypeAsByte has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public static byte getDataTypeAsByte(@NonNull DataType type) {
                                                switch (type) {
                                                    case FLOAT:
                                                        return DType.FLOAT;
                                                    case DOUBLE:
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language