summaryrefslogtreecommitdiff
path: root/notebooks
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2023-09-03 01:10:27 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2023-09-03 01:10:27 +0200
commit4f15f4681c8c964ef9c0f66b38c749b5209a6e3d (patch)
treefcd86d6418f03d3c7b91fc0df1c2b086a535df1b /notebooks
parent7239bce214607c70a7a91358586f265b2f74de7b (diff)
Delete scratch notebook
Diffstat (limited to 'notebooks')
-rw-r--r--notebooks/Untitled.ipynb300
1 files changed, 0 insertions, 300 deletions
diff --git a/notebooks/Untitled.ipynb b/notebooks/Untitled.ipynb
deleted file mode 100644
index 5dbda4c..0000000
--- a/notebooks/Untitled.ipynb
+++ /dev/null
@@ -1,300 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "code",
- "execution_count": 1,
- "id": "8468e45a",
- "metadata": {
- "tags": []
- },
- "outputs": [],
- "source": [
- "import torch"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 2,
- "id": "d1bc956b",
- "metadata": {
- "tags": []
- },
- "outputs": [
- {
- "data": {
- "text/plain": [
- "True"
- ]
- },
- "execution_count": 2,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "torch.cuda.is_available()"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 3,
- "id": "4660ff12-74d7-4c8a-a65b-2c0d90326e26",
- "metadata": {
- "tags": []
- },
- "outputs": [
- {
- "ename": "AttributeError",
- "evalue": "module 'torch' has no attribute 'cudnn'",
- "output_type": "error",
- "traceback": [
- "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
- "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
- "Cell \u001b[0;32mIn[3], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mtorch\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcudnn\u001b[49m\n",
- "\u001b[0;31mAttributeError\u001b[0m: module 'torch' has no attribute 'cudnn'"
- ]
- }
- ],
- "source": [
- "torch.cudnn"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 3,
- "id": "652cfb26",
- "metadata": {
- "tags": []
- },
- "outputs": [
- {
- "data": {
- "text/plain": [
- "1"
- ]
- },
- "execution_count": 3,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "torch.cuda.device_count()"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 4,
- "id": "0fc5e328",
- "metadata": {
- "tags": []
- },
- "outputs": [
- {
- "data": {
- "text/plain": [
- "0"
- ]
- },
- "execution_count": 4,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "torch.cuda.current_device()"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 5,
- "id": "4ed93c82",
- "metadata": {
- "tags": []
- },
- "outputs": [
- {
- "data": {
- "text/plain": [
- "<torch.cuda.device at 0x7fbf7bf7b9a0>"
- ]
- },
- "execution_count": 5,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "torch.cuda.device(0)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 6,
- "id": "c03841ce",
- "metadata": {
- "tags": []
- },
- "outputs": [
- {
- "data": {
- "text/plain": [
- "'NVIDIA GeForce RTX 2070'"
- ]
- },
- "execution_count": 6,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "torch.cuda.get_device_name(0)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 7,
- "id": "2fba9680-0c73-4a62-b24d-ceea79874717",
- "metadata": {
- "tags": []
- },
- "outputs": [
- {
- "data": {
- "text/plain": [
- "'11.7'"
- ]
- },
- "execution_count": 7,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "torch.version.cuda"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 10,
- "id": "7e62de10",
- "metadata": {},
- "outputs": [],
- "source": [
- "t = torch.randn((2, 1, 3, 64))"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 11,
- "id": "fc221b4e",
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "torch.Size([2, 1, 3, 64])"
- ]
- },
- "execution_count": 11,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "t.shape"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 12,
- "id": "ab80d75e",
- "metadata": {},
- "outputs": [],
- "source": [
- "import torch.nn.functional as F"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 21,
- "id": "bfe1fc90",
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "torch.Size([2, 1, 7, 128])"
- ]
- },
- "execution_count": 21,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "F.interpolate(t, scale_factor=[2.5, 2], mode=\"nearest\").shape"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 18,
- "id": "f69fa1fc",
- "metadata": {},
- "outputs": [],
- "source": [
- "f = torch.nn.Conv2d(1, 1, 3, 1, padding=1)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 20,
- "id": "cd6df204",
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "torch.Size([2, 1, 64, 64])"
- ]
- },
- "execution_count": 20,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "f(torch.randn(2, 1, 64, 64)).shape"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "41693566",
- "metadata": {},
- "outputs": [],
- "source": []
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "Python 3 (ipykernel)",
- "language": "python",
- "name": "python3"
- },
- "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.9.4"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 5
-}