Total 4 steps for connect & exit Jupyter Notebook with a SSH server:
- SSH to the Server. Run:
jupyter notebook --no-browser --port=8888
- Open another terminal window on your local machine, input:
import math | |
import typing | |
import torch | |
class StringArray: | |
def __init__(self, strings : typing.List[str], encoding : typing.Literal['ascii', 'utf_16_le', 'utf_32_le'] = 'utf_16_le'): | |
strings = list(strings) | |
self.encoding = encoding | |
self.multiplier = dict(ascii = 1, utf_16_le = 2, utf_32_le = 4)[encoding] | |
self.data = torch.ByteTensor(torch.ByteStorage.from_buffer(''.join(strings).encode(encoding))) |