Package deepboof.io.torch7
Class ParseTorch7
java.lang.Object
deepboof.io.torch7.ParseTorch7
- Direct Known Subclasses:
ParseAsciiTorch7,ParseBinaryTorch7
Parser for binary Torch 7 serialized objects.
Torch source code:- torch7/File.lua
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DataInputprotected Map<Integer,TorchReferenceable> protected FileInputStreamprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanParses 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>
Tabstract 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 booleanabstract doubleabstract floatabstract intreadS32()abstract longreadS64()abstract int[]readShape(int dimension) abstract Stringabstract TorchTypereadType()abstract intreadU8()setVerbose(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
-