def __init__(self, weight_file):
    with open(weight_file, 'rb') as w_f:
        (major,) = struct.unpack('i', w_f.read(4))
        (minor,) = struct.unpack('i', w_f.read(4))
        (revision,) = struct.unpack('i', w_f.read(4))
        if ((((major * 10) + minor) >= 2) and (major < 1000) and (minor < 1000)):
            w_f.read(8)
        else:
            w_f.read(4)
        transpose = ((major > 1000) or (minor > 1000))
        binary = w_f.read()
    self.offset = 0
    self.all_weights = np.frombuffer(binary, dtype='float32')
def __init__(self, weight_file):
    with open(weight_file, 'rb') as w_f:
        (major,) = struct.unpack('i', w_f.read(4))
        (minor,) = struct.unpack('i', w_f.read(4))
        (revision,) = struct.unpack('i', w_f.read(4))
        if ((((major * 10) + minor) >= 2) and (major < 1000) and (minor < 1000)):
            w_f.read(8)
        else:
            w_f.read(4)
        transpose = ((major > 1000) or (minor > 1000))
        binary = w_f.read()
    self.offset = 0
    self.all_weights = np.frombuffer(binary, dtype='float32')