You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
85 lines
1.6 KiB
Plaintext
85 lines
1.6 KiB
Plaintext
{
|
|
"metadata": {
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.6.9-final"
|
|
},
|
|
"orig_nbformat": 2,
|
|
"kernelspec": {
|
|
"name": "python3",
|
|
"display_name": "Python 3.6.9 64-bit",
|
|
"metadata": {
|
|
"interpreter": {
|
|
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2,
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"import os,sys,math\n",
|
|
"import numpy as np\n",
|
|
"\n",
|
|
"import matplotlib.pyplot as plt\n",
|
|
"\n",
|
|
"import torch\n",
|
|
"import torch.nn as nn\n",
|
|
"import torch.nn.functional as F\n",
|
|
"\n",
|
|
"import mnist_dataloader\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 14,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"output_type": "stream",
|
|
"name": "stdout",
|
|
"text": [
|
|
"torch.Size([])\ntorch.Size([])\n[1, 2, 3]\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"a = torch.randn(10,14)\n",
|
|
"b = a.shape[1:1]\n",
|
|
"print(b)\n",
|
|
"b.numel()\n",
|
|
"\n",
|
|
"print(b)\n",
|
|
"\n",
|
|
"b = torch.Size([1])\n",
|
|
"c = torch.Size([2,3])\n",
|
|
"d = torch.Size(torch.cat([torch.tensor(b),torch.tensor(c)]))\n",
|
|
"\n",
|
|
"d = [*b,*c]\n",
|
|
"\n",
|
|
"print(d)\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": []
|
|
}
|
|
]
|
|
} |