Imported from https://github.com/HLT-ISTI/QuaNet