Package deepboof.io.torch7
Class ParseTorch7
java.lang.Object
deepboof.io.torch7.ParseTorch7
- Direct Known Subclasses:
ParseAsciiTorch7,ParseBinaryTorch7
public abstract class ParseTorch7 extends Object
Parser for binary Torch 7 serialized objects.
Torch source code:- torch7/File.lua
-
Field Summary
Fields Modifier and Type Field Description protected DataInputinputprotected Map<Integer,TorchReferenceable>masterTableprotected FileInputStreamstreamprotected booleanverbose -
Constructor Summary
Constructors Constructor Description ParseTorch7() -
Method Summary
Modifier and Type Method Description booleanisVerbose()List<TorchObject>parse(File file)Parses serialized objects inside the specified file.<T> TparseIntoBoof(File file)Parses the file, grabs the first element, and converts it into a Deep Boof object.<T extends TorchObject>
TparseOne(File file)abstract voidreadArrayByte(int size, byte[] storage)abstract voidreadArrayChar(int size, char[] storage)abstract voidreadArrayDouble(int size, double[] storage)abstract voidreadArrayFloat(int size, float[] storage)abstract voidreadArrayLong(int size, long[] storage)abstract booleanreadBoolean()abstract doublereadDouble()abstract floatreadFloat()abstract intreadS32()abstract longreadS64()abstract int[]readShape(int dimension)abstract StringreadString()abstract TorchTypereadType()abstract intreadU8()ParseTorch7setVerbose(boolean verbose)intstringToVersionNumber(String line)
-
Field Details
-
stream
-
input
-
masterTable
-
verbose
protected boolean verbose
-
-
Constructor Details
-
ParseTorch7
public ParseTorch7()
-
-
Method Details
-
parseOne
- Throws:
IOException
-
parseIntoBoof
Parses the file, grabs the first element, and converts it into a Deep Boof object.- Throws:
IOException
-
parse
Parses serialized objects inside the specified file. A list of the top level objects is returned- Parameters:
file- Input file- Returns:
- List of
TorchObject - Throws:
IOException
-
stringToVersionNumber
-
readShape
- Throws:
IOException
-
readType
- Throws:
IOException
-
readBoolean
- Throws:
IOException
-
readDouble
- Throws:
IOException
-
readFloat
- Throws:
IOException
-
readString
- Throws:
IOException
-
readS64
- Throws:
IOException
-
readS32
- Throws:
IOException
-
readU8
- Throws:
IOException
-
readArrayDouble
- Throws:
IOException
-
readArrayFloat
- Throws:
IOException
-
readArrayChar
- Throws:
IOException
-
readArrayByte
- Throws:
IOException
-
readArrayLong
- Throws:
IOException
-
isVerbose
public boolean isVerbose() -
setVerbose
-