nd4j-serde/nd4j-kryo/src/main/java/org/nd4j/Nd4jSerializer.java
@Override
    public INDArray read(Kryo kryo, Input input, Class<INDArray> type) {
        DataInputStream dis = new DataInputStream(input);
        try {
            return Nd4j.read(dis);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        //Note: input should NOT be closed manually here - may be needed elsewhere (and closing here will cause serialization to fail)
    }
@Override
    public INDArray read(Kryo kryo, Input input, Class<INDArray> type) {
        DataInputStream dis = new DataInputStream(input);
        try {
            return Nd4j.read(dis);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        //Note: input should NOT be closed manually here - may be needed elsewhere (and closing here will cause serialization to fail)
    }
@ Override public INDArray read ( Kryo kryo , Input input , Class < INDArray > type ) { DataInputStream dis = new DataInputStream ( input ) ; try { return Nd4j . read ( dis ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } //Note: input should NOT be closed manually here - may be needed elsewhere (and closing here will cause serialization to fail) }
Reads bytes and returns a new object of the specified concrete opType.
<p>
Before Kryo can be used to read child objects, {@link Kryo#reference(Object)} must be called with the parent object to
ensure it can be referenced by the child objects. Any serializer that uses {@link Kryo} to read a child object may need to
be reentrant.
<p>
This method should not be called directly, instead this serializer can be passed to {@link Kryo} read methods that accept a
serialier.

@param kryo
@param input
@param type
@return May be null if {@link #getAcceptsNull()} is true.
Reads bytes and returns a new object of the specified concrete opType . <p > Before Kryo can be used to read child objects { @link Kryo#reference ( Object ) } must be called with the parent object to ensure it can be referenced by the child objects . Any serializer that uses { @link Kryo } to read a child object may need to be reentrant . <p > This method should not be called directly instead this serializer can be passed to { @link Kryo } read methods that accept a serialier .