variable.py 366 Bytes
Newer Older
Philipp Arras's avatar
Philipp Arras committed
1
import nifty5 as ift
2

Philipp Arras's avatar
Philipp Arras committed
3
from .model import Model
4
5


Philipp Arras's avatar
Philipp Arras committed
6
class Variable(Model):
7
8
9
10
    """
    Returns the MultiField.
    """
    def __init__(self, position):
Philipp Arras's avatar
Philipp Arras committed
11
        super(Variable, self).__init__(position)
12
13
14
15
16
17

        self._value = position
        self._gradient = ift.ScalingOperator(1., position.domain)

    def at(self, position):
        return self.__class__(position)