Example #1
0
def view_as(self, other):
    if not isinstance(other, Tensor):
        raise ValueError('The other should be a torch tensor.')
    if self._static_shape:
        raise RuntimeError('Can not view a leaf variable, it owns the static sizes.')
    return reshape(self, shape=None, shape_like=other)
Example #2
0
def view_as(self, other):
    if not isinstance(other, Tensor):
        raise ValueError('The other should be a torch tensor.')
    return reshape(self, shape=None, shape_like=other)
Example #3
0
def view(self, *args):
    if self._static_shape:
        raise RuntimeError('Can not view a leaf variable, it owns the static sizes.')
    return reshape(self, shape=args)
Example #4
0
def view(self, *args):
    return reshape(self, shape=args)