- function default parameter
def f(a, b=3):
return a + b
f(a)
##### fig 1. | |
##### nsys profile -w true -t cuda,nvtx,osrt,cudnn,cublas -s cpu --cudabacktrace=true -x true -f true -o fig1 torchrun --nproc_per_node 3 run.py --devs 0 2 3 | |
import os | |
import time | |
import torch | |
import torch.distributed as dist | |
from threading import Thread | |
from torch.profiler import ProfilerActivity, profile |
# user, host, full path, and time/date | |
# on two lines for easier vgrepping | |
# entry in a nice long thread on the Arch Linux forums: https://bbs.archlinux.org/viewtopic.php?pid=521888#p521888 | |
# conda config --set changeps1 False | |
PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %H:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%} | |
%{\e[0;34m%}%B└─%B[$CONDA_DEFAULT_ENV] <$(git_prompt_info)>%{\e[0m%}%b ' | |
PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' |
import torch
import argparse
from torch import nn
from torch.nn import LSTM
parser = argparse.ArgumentParser(description="Python tensor type resolver / example 1")
parser.add_argument("--len", type=int, default=5, help="length of sequence")
This repository is the official PyTorch implementation of Tag2Pix
## | |
using QuadGK | |
using Calculus | |
## | |
D = 0.39 | |
H = 0.42 | |
W = 0.63 | |
r_max = 0.06 | |
N = 300 |
i_square = 1.0 | |
n_square = 30 | |
h = 0.102 | |
H = 0.178 | |
W = 0.178 | |
coeff = i_square * n_square * 10^-7 | |
function B1(x, y) | |
r = sqrt(x^2 + y^2) | |
dl = H / 500 |