'Move all tensors from self.buffer_active to self.buffer
the idea is to reuse those tensors for other optrees.'

def _buf_free(self):

    for shape in self.buf_active:
        self.buf[shape].extend(self.buf_active[shape])
        self.buf_active[shape] = []
