Source code for qewton.backends.param
from abc import abstractmethod
from qewton.backends.base import Backend, TensorType
[docs]
class ParameterBackend(Backend[TensorType]):
[docs]
@staticmethod
@abstractmethod
def initialize(shape=None, tensor=None) -> TensorType:
pass
[docs]
@staticmethod
@abstractmethod
def to(data, device) -> TensorType:
pass
[docs]
@staticmethod
@abstractmethod
def requires_grad(data, requires_grad: bool) -> TensorType:
pass