def unpack(self, x) -> _torch.Tensor:
        """
        Function that will be called to return a
         value to compute a new tensor, which is the one actually used during the backward pass.
        """
        if isinstance(x, tuple):
            key, op, device, y = x

            look_up = isinstance(key, str)
            if look_up:
                v = self.tensor_dict[key]
            else:
                v = key

            v = _decompress_tensor(v, device)

            if look_up:
                self.tensor_dict[key] = v

            x = op(v)

        return x

        Function that will be called to return a
         value to compute a new tensor, which is the one actually used during the backward pass.
        
coremltools/optimize/torch/palettization/_fake_palettizer_tensor_hook.py