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
| #!/bin/bash | |
| #SBATCH -J OTH-xinyu-xxx # 任务名 | |
| #SBATCH -N 2 # 申请 2 个节点 | |
| #SBATCH --gres=gpu:2 # 每个节点申请 2 张 GPU | |
| #SBATCH --cpus-per-gpu=16 # 每张 GPU 对应申请 16 CPU 核心 | |
| #SBATCH --mem-per-cpu=8G # 每个 CPU 核心对应申请 8G 内存 | |
| #SBATCH -o logs/%x_%j/%x_%j.out # stdout 日志:任务名_任务ID.out | |
| #SBATCH -e logs/%x_%j/%x_%j.err # stderr 日志:任务名_任务ID.err | |
| set -euo pipefail |
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
| #!/bin/bash | |
| #SBATCH -J OTH-xinyu-xxx # 任务名 | |
| #SBATCH -N 2 # 申请 2 个节点 | |
| #SBATCH --gres=gpu:2 # 每个节点申请 2 张 GPU | |
| #SBATCH --cpus-per-gpu=16 # 每张 GPU 对应申请 16 CPU 核心 | |
| #SBATCH --mem-per-cpu=8G # 每个 CPU 核心对应申请 8G 内存 | |
| #SBATCH -o logs/%x_%j/%x_%j.out # stdout 日志:任务名_任务ID.out | |
| #SBATCH -e logs/%x_%j/%x_%j.err # stderr 日志:任务名_任务ID.err | |
| set -euo pipefail |
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
| #!/bin/bash | |
| #SBATCH -J OTH-xinyu-xxx # 任务名 | |
| #SBATCH -N 1 # 申请 1 个节点 | |
| #SBATCH --gres=gpu:1 # 每个节点申请 1 张 GPU | |
| #SBATCH --cpus-per-gpu=16 # 每张 GPU 对应申请 16 CPU 核心 | |
| #SBATCH --mem-per-cpu=8G # 每个 CPU 核心对应申请 8G 内存 | |
| #SBATCH -o logs/%x_%j/%x_%j.out # stdout 日志:任务名_任务ID.out | |
| #SBATCH -e logs/%x_%j/%x_%j.err # stderr 日志:任务名_任务ID.err | |
| set -euo pipefail |
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
| # | |
| # pc2v9.ini - settings for pc2 | |
| # Mon Jul 03 19:08:22 2017 | |
| # | |
| # pc2@ecs.csus.edu | |
| # | |
| # For all possible .ini entries see pc2v9.ini in the samps directory, or search the pc2 wiki | |
| [client] |
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 tensorflow as tf | |
| from tensorflow.python.tools import freeze_graph | |
| from tensorflow.python.tools import optimize_for_inference_lib | |
| def export_model(sess, input_node_names, output_node_name, | |
| output_dir, MODEL_NAME, n_saved=0): | |
| tf.train.write_graph(sess.graph_def, output_dir, | |
| MODEL_NAME + '.pbtxt', True) | |
| tf.train.Saver().save(sess, output_dir + '/' + MODEL_NAME) |
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
| # In python3, zip returns a (iterable) zip object rather than a list | |
| # ----------------0---------------- | |
| # input: [1,2,3] [4,5,6] | |
| # output: [(1, 4), (2, 5), (3, 6)] | |
| a = [1, 2, 3] | |
| b = [4, 5, 6] | |
| l = zip(a, b) | |
| print(list(l)) | |
| # ----------------1---------------- |
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
| // return a prime list | |
| long* make_prime(long N = 31700) { | |
| bool *isPrime = new bool[N]; | |
| long *primeList = new long[N]; | |
| memset(isPrime, 1, N * sizeof(bool)); | |
| isPrime[0] = false; | |
| isPrime[1] = false; | |
| long num_prime = 0; | |
| for (long i = 2; i < N; i++) { |