Examples of slice()


Examples of de.jungblut.math.DoubleVector.slice()

    DoubleVector lastOutput = input;
    for (int i = 0; i < layerSizes.length; i++) {
      lastOutput = computeHiddenActivations(lastOutput, weights[i]);
    }
    // slice the hidden bias away
    return lastOutput.slice(1, lastOutput.getDimension());
  }

  /**
   * Creates a reconstruction of the input using the given hidden activations.
   * (That, what is returned by {@link #predict(DoubleVector)}).
View Full Code Here

Examples of io.airlift.slice.DynamicSliceOutput.slice()

            if (page != null) {
                headers.put(CONTENT_TYPE, PRESTO_PAGES);
                headers.put(PRESTO_PAGE_NEXT_TOKEN, String.valueOf(pageToken + 1));
                DynamicSliceOutput output = new DynamicSliceOutput(256);
                PagesSerde.writePages(createTestingBlockEncodingManager(), output, page);
                return new TestingResponse(HttpStatus.OK, headers.build(), output.slice().getInput());
            }
            else if (taskBuffer.isFinished()) {
                headers.put(PRESTO_PAGE_NEXT_TOKEN, String.valueOf(pageToken));
                return new TestingResponse(HttpStatus.GONE, headers.build(), new byte[0]);
            }
View Full Code Here

Examples of io.airlift.slice.Slice.slice()

        Slice tupleSlice = tuple.getTupleSlice();
        assertEquals(tupleSlice.length(), binary.length() + SIZE_OF_INT + SIZE_OF_BYTE);
        // null bit set is in first byte
        assertEquals(tupleSlice.getByte(0), 0);
        assertEquals(tupleSlice.getInt(SIZE_OF_BYTE), binary.length() + SIZE_OF_INT + SIZE_OF_BYTE);
        assertEquals(tupleSlice.slice(SIZE_OF_INT + SIZE_OF_BYTE, binary.length()), binary);
    }

    @Test
    public void testSingleVariableLengthNull()
    {
View Full Code Here

Examples of io.airlift.slice.SliceOutput.slice()

            }

            SliceOutput output = new DynamicSliceOutput(sizeEstimate);
            PagesSerde.writePages(output, new Page(blocks));
            BlockBuilder builder = new BlockBuilder(SINGLE_VARBINARY);
            builder.append(output.slice());
            return builder.build();
        }

        @Override
        public Block evaluateFinal()
View Full Code Here

Examples of io.netty.buffer.ByteBuf.slice()

        } else {
            this.delimiters = new ByteBuf[delimiters.length];
            for (int i = 0; i < delimiters.length; i ++) {
                ByteBuf d = delimiters[i];
                validateDelimiter(d);
                this.delimiters[i] = d.slice(d.readerIndex(), d.readableBytes());
            }
            lineBasedDecoder = null;
        }
        this.maxFrameLength = maxFrameLength;
        this.stripDelimiter = stripDelimiter;
View Full Code Here

Examples of io.netty.buffer.ChannelBuffer.slice()

        if (d < len) {
            encode3to4(src, d + off, len - d, dest, e, dialect);
            e += 4;
        } // end if: some padding needed

        return dest.slice(0, e);
    }

    private static void encode3to4(
            ChannelBuffer src, int srcOffset, int numSigBytes,
            ChannelBuffer dest, int destOffset, Base64Dialect dialect) {
View Full Code Here

Examples of io.netty.buffer.CompositeByteBuf.slice()

      int vectorIndex = 0;

      for (VectorWrapper<?> vv : container) {
        SerializedField fmd = fields.get(vectorIndex);
        ValueVector v = vv.getValueVector();
        ByteBuf bb = cbb.slice(bufferOffset, fmd.getBufferLength());
//        v.load(fmd, cbb.slice(bufferOffset, fmd.getBufferLength()));
        v.load(fmd, bb);
        bb.release();
        vectorIndex++;
        bufferOffset += fmd.getBufferLength();
View Full Code Here

Examples of java.nio.ByteBuffer.slice()

           
              // pick up any remaining data for delivery
           
            if ( in_buffer.hasRemaining()){
             
              message = new PooledByteBufferImpl( new DirectByteBuffer( in_buffer.slice()));
             
              forward  = true;
            }
          }
        }
View Full Code Here

Examples of java.nio.ByteBuffer.slice()

    if (element instanceof PcapPacketImpl) {
      final PcapPacketImpl p = (PcapPacketImpl) element;

      final ByteBuffer old = p.getRecordByteBuffer();
      if (old.order() == this.editor.order()) {
        buffer = old.slice();
      } else {
        buffer =
            PcapRecordIterator.convertByteOrder(BufferUtils.copy(old),
                this.editor.order());
      }
View Full Code Here

Examples of java.nio.ByteBuffer.slice()

          transferBuffer.flip();
          buffers.add(transferBuffer);

        } else {
          transferBuffer.flip();
          buffers.add(transferBuffer.slice());
        }
      }
    } while (read > 0);
   
    nonBlockingStream.append(buffers.toArray(new ByteBuffer[buffers.size()]), null);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.