def unsqueeze(tensor: T.Tensor, axis: int) -> T.Tensor:
"""
Return tensor with a new axis inserted.
Args:
tensor: A tensor.
axis: The desired axis.
Returns:
tensor: A tensor with the new axis inserted.
"""
return torch.unsqueeze(tensor, axis)
评论列表
文章目录