def _int_(self): """Cast to an int32 tensor. Returns ------- dragon.vm.torch.Tensor The self. """ return array_funcs.cast(self, 'int32', True)
def half_(self): """Cast to a float16 tensor. Returns ------- dragon.vm.torch.Tensor The self. """ return array_funcs.cast(self, 'float16', True)
def _int(self): """Return an int32 tensor with the same data. Returns ------- dragon.vm.torch.Tensor The output tensor. """ return array_funcs.cast(self, 'int32', False)
def double_(self): """Cast to a float64 tensor. Returns ------- dragon.vm.torch.Tensor The self. """ return array_funcs.cast(self, 'float64', True)
def half(self): """Return a float16 tensor with the same data. Returns ------- dragon.vm.torch.Tensor The output tensor. """ return array_funcs.cast(self, 'float16', False)
def byte_(self): """Cast to an uint8 tensor. Returns ------- dragon.vm.torch.Tensor The self. """ return array_funcs.cast(self, 'uint8', True)
def byte(self): """Return an uint8 tensor with the same data. Returns ------- dragon.vm.torch.Tensor The output tensor. """ return array_funcs.cast(self, 'uint8', False)
def bool_(self): """Cast to a bool tensor. Returns ------- dragon.vm.torch.Tensor The self. """ return array_funcs.cast(self, 'bool', True)
def bool(self): """Return a bool tensor with the same data. Returns ------- dragon.vm.torch.Tensor The output tensor. """ return array_funcs.cast(self, 'bool', False)
def _type(self, dtype=None): """Return the data type. If ``dtype`` is not **None**, cast ``self`` to the new tensor. Parameters ---------- dtype : str, optional The specified type. Returns ------- Union[str, dragon.vm.torch.Tensor] The data type or new tensor. """ if dtype is None: return self.dtype return array_funcs.cast(self, dtype, False)