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)
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)
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)
def view(self, *args): return reshape(self, shape=args)