Skip to content

Commit ba13a31

Browse files
committed
Comment out the readObject hacks
1 parent 9146164 commit ba13a31

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

src/edu/stanford/nlp/coref/neural/NeuralCorefModel.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public NeuralCorefModel(SimpleMatrix antecedentMatrix, SimpleMatrix anaphorMatri
4141
this.wordEmbeddings = wordEmbeddings;
4242
}
4343

44-
// TODO: remove when ejml is upgraded
44+
/*
45+
// TODO: remove when ejml 0.38 is upgraded
4546
private void readObject(ObjectInputStream in)
4647
throws IOException, ClassNotFoundException
4748
{
@@ -58,6 +59,7 @@ private void readObject(ObjectInputStream in)
5859
.map(x->new SimpleMatrix(x))
5960
.collect(Collectors.toList());
6061
}
62+
*/
6163

6264
/*
6365
private void readObject(ObjectInputStream in)

src/edu/stanford/nlp/neural/Embedding.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,16 @@ public Embedding(String wordFile, String vectorFile, int embeddingSize) {
8585
loadWordVectors(wordFile, vectorFile);
8686
}
8787

88+
/*
89+
// This hack was for ejml 0.38
8890
private void readObject(ObjectInputStream in)
8991
throws IOException, ClassNotFoundException
9092
{
9193
in.defaultReadObject();
9294
9395
ConvertModels.transformMap(wordVectors, x -> new SimpleMatrix(x));
9496
}
97+
*/
9598

9699
/*
97100
private void readObject(ObjectInputStream in)

src/edu/stanford/nlp/parser/dvparser/DVModel.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,12 @@ public class DVModel implements Serializable {
7878

7979
private static final Function<DMatrixRMaj, SimpleMatrix> convertDenseMatrix = matrix -> SimpleMatrix.wrap(matrix);
8080

81+
/*
8182
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
8283
in.defaultReadObject();
8384
8485
// TODO: get rid of this when ejml is upgraded to a version which can deserialize SimpleMatrix
86+
// ejml 0.38 had a bug when reading matrices
8587
binaryTransform.replaceAll(x -> new SimpleMatrix(x));
8688
unaryTransform.replaceAll((x, y) -> new SimpleMatrix(y));
8789
binaryScore.replaceAll(x -> new SimpleMatrix(x));
@@ -90,6 +92,7 @@ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundE
9092
9193
identity = SimpleMatrix.identity(numRows);
9294
}
95+
*/
9396

9497

9598
/**

src/edu/stanford/nlp/sentiment/SentimentModel.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ private void readObject(ObjectInputStream in)
182182
}
183183
*/
184184

185+
/*
185186
private void readObject(ObjectInputStream in)
186187
throws IOException, ClassNotFoundException
187188
{
@@ -201,6 +202,7 @@ private void readObject(ObjectInputStream in)
201202
unaryClassification.replaceAll((x, y) -> new SimpleMatrix(y));
202203
wordVectors.replaceAll((x, y) -> new SimpleMatrix(y));
203204
}
205+
*/
204206

205207

206208
/**

0 commit comments

Comments
 (0)