viking-sudo-rm / stacknn-core

Pip-installable differentiable stacks in PyTorch!
65 stars 2 forks source link

API change #1

Closed viking-sudo-rm closed 4 years ago

viking-sudo-rm commented 4 years ago

Should change API from classmethod empty() and method update() to two methods reset()and update().

This would make get_num_actions() a property of an instance, not a class. This makes it easier to change the number of actions for multipush/multipop stacks.

viking-sudo-rm commented 4 years ago

Should be able to do this in a way that doesn't break old API. In other words, we define

@classmethod
def empty(cls, batch_size, stack_dim, device):
    stack = cls(stack_dim)
    stack.reset(batch_size, device)
    return stack
viking-sudo-rm commented 4 years ago

Fixed in 95446f2.