Random newlines in Github Gist iPython notebooks

37 Views Asked by At

I have noticed across all of my Jupyter notebooks stored as Github Gists that newlines have been added to them, in both new and old notebooks. Am I doing something wrong? Here is an example:

enter image description here

The code for the first block is:

{
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "torch.Size([30522])"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import torch\n",
    "\n",
    "vec = torch.max(\n",
    "    torch.log(\n",
    "        1 + torch.relu(output.logits)\n",
    "    ) * tokens.attention_mask.unsqueeze(-1),\n",
    "dim=1)[0].squeeze()\n",
    "\n",
    "vec.shape"
   ]
  }

And the link

0

There are 0 best solutions below