def get_representation(self, x):
    if (self.layer == (- 1)):
        return self.net(x)
    if (not self.hook_registered):
        self._register_hook()
    _ = self.net(x)
    hidden = self.hidden
    self.hidden = None
    assert (hidden is not None), f'hidden layer {self.layer} never emitted an output'
    return hidden
def get_representation(self, x):
    if (self.layer == (- 1)):
        return self.net(x)
    if (not self.hook_registered):
        self._register_hook()
    _ = self.net(x)
    hidden = self.hidden
    self.hidden = None
    assert (hidden is not None), f'hidden layer {self.layer} never emitted an output'
    return hidden