Browse Source

Merge pull request #1176 from lingbai-kong/ndarrayload

fix: improve unpickler speed with BufferedStream
tags/v0.110.4-Transformer-Model
Haiping GitHub 2 years ago
parent
commit
74afa14333
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      src/TensorFlowNET.Core/NumPy/Implementation/NumPyImpl.Creation.cs

+ 3
- 2
src/TensorFlowNET.Core/NumPy/Implementation/NumPyImpl.Creation.cs View File

@@ -101,9 +101,10 @@ namespace Tensorflow.NumPy

Array ReadObjectMatrix(BinaryReader reader, Array matrix, int[] shape)
{
Stream stream = reader.BaseStream;
Stream deflateStream = reader.BaseStream;
BufferedStream bufferedStream = new BufferedStream(deflateStream);
var unpickler = new Unpickler();
return (MultiArrayPickleWarpper)unpickler.load(stream);
return (MultiArrayPickleWarpper)unpickler.load(bufferedStream);
}

public (NDArray, NDArray) meshgrid<T>(T[] array, bool copy = true, bool sparse = false)


Loading…
Cancel
Save