This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from d2lbook import notebook | |
import nbformat | |
import os | |
import glob | |
import re | |
import nbconvert | |
def find_files(): | |
""" | |
Find all jupyter notebooks from the root dir. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################## | |
## This script tests if the syntax for slides is correct | |
## after generating the machine translations in d2l. | |
## Useful to debug errors all in one go like shown below | |
## Example: | |
## assert len(start) == len(end), f'some {p} are not enclosed in {text}' | |
## AssertionError: some ('[**', '**]') are not enclosed in [**Kayıp** hesaplanmadan önce] | |
######################################################## |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conda create --name d2l python=3.8 -y | |
conda activate d2l | |
pip install torch==1.8.1 torchvision==0.9.1 | |
cd d2l-en | |
pip install mu-notedown | |
python setup.py develop | |
jupyter notebook --generate-config | |
echo "c.NotebookApp.contents_manager_class = 'notedown.NotedownContentsManager'" | tee -a ~/.jupyter/jupyter_notebook_config.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################## | |
# Requires the following modules: | |
# d2lbook, bibtexparser, pybtex | |
########################################## | |
import re | |
from d2lbook import slides, notebook, markdown | |
from collections import defaultdict | |
import nbformat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env_name="conda-env-.conda-d2l-py" | |
display_name="d2l" | |
for f in chapter*/*ipynb; do | |
sed -i s/\"language_info\":\ {/\"instance_type\":\ \"ml.g4dn.xlarge\",\ \"kernelspec\":\ {\"display_name\":\ \"$display_name\",\"language\":\ \"python\",\ \"name\":\ \"$env_name\"\},\"language_info\":\ {/g $f | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ATen/ATen.h> | |
#include <ATen/Dispatch.h> | |
#include <ATen/NativeFunctions.h> | |
#include <ATen/native/Resize.h> | |
#include <ATen/native/Cross.h> | |
namespace at { namespace native { | |
DEFINE_DISPATCH(cross_stub); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
# your code... | |
a = torch.tensor([1,2]) | |
b = torch.tensor([3,4]) | |
c = torch.cat([a, b]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Inside the src directory, create the following dirs | |
mkdir _build | |
mkdir _install | |
# Run Build | |
cd _build | |
cmake ../. -DCMAKE_INSTALL_PREFIX=../_install -DOCIO_BUILD_DOCS=ON -DOCIO_BUILD_GPU_TESTS=OFF -DPython_EXECUTABLE=$(which python) -DOCIO_INSTALL_EXT_PACKAGES=ALL | |
cmake --build . --target install --config Release -j 8 | |
# Confirm all 3 tests pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. | |
# All rights reserved. | |
# | |
# For the licensing terms see $ROOTSYS/LICENSE. | |
# For the list of contributors see $ROOTSYS/README/CREDITS. | |
# CMakeLists.txt for the ROOT tutorials programs. | |
# Author: Pere Mato, 25/10/2010 | |
cmake_minimum_required(VERSION 3.9 FATAL_ERROR) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Works on OS X, with conda installed. | |
# Create conda environment for PyTorch Geometric | |
echo "Creating pyg environment" | |
conda create -n pyg python=3.6 | |
echo "Activate pyg Env" | |
source activate pyg | |
# PyTorch Conda Installation |
NewerOlder