(self, stop, start=0, step=1, type_as=None)
| 1999 | return torch.ones(shape, dtype=type_as.dtype, device=type_as.device) |
| 2000 | |
| 2001 | def arange(self, stop, start=0, step=1, type_as=None): |
| 2002 | if type_as is None: |
| 2003 | return torch.arange(start, stop, step) |
| 2004 | else: |
| 2005 | return torch.arange(start, stop, step, device=type_as.device) |
| 2006 | |
| 2007 | def full(self, shape, fill_value, type_as=None): |
| 2008 | if isinstance(shape, int): |