Skip to content

Instantly share code, notes, and snippets.

# Essentials ###########################################################
unbind C-b
set -g prefix C-q
# Reload config
bind R source-file ~/.tmux.conf \; display-message "Tmux configuration reloaded"
# Basic terminal defaults
setw -g mode-keys vi
cmake_minimum_required(VERSION 3.10)
project(cppgen VERSION 0.0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_executable(remapping remapping.cc)
target_link_libraries(remapping stdc++ "-framework Foundation" "-framework IOKit" objc)
cmake_minimum_required(VERSION 3.10)
project(cppgen VERSION 0.0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
link_libraries(pthread)
add_executable(cppgen cppgen.cc)
add_executable(cppgen-dup2 cppgen-dup2.cc)
add_executable(cppgen-lock cppgen-lock.cc)
with 0 points
with 160 points
with 60 points
with 140 points
with 64 points
with 52 points
with 84 points
with 146 points
with 52 points
with 76 points
#include "skel.h"
#include <torch/extension.h>
namespace py = pybind11;
PYBIND11_MODULE(skel, m) {
py::class_<Skel>(m, "Skel").def(py::init<>()).def("tensor", &Skel::tensor)
/**/
import timeit
import torch
from torch import nn
from torch.nn import functional as F
class Flags:
pass
import array
import os
import socket
import mmap
import time
def send_fds(sock, msg, fds): # not yet used
return sock.sendmsg(
// Copied from
// https://raw.githubusercontent.com/tensorflow/tensorflow/9590c4c32dd4346ea5c35673336f5912c6072bf2/tensorflow/core/platform/default/notification.h
// and slightly modified.
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
import os
import select
import sys
import termios
import gym
def play():
env = gym.make("AdventureNoFrameskip-v4" if len(sys.argv) < 2 else sys.argv[1])
import os
import sys
import tensorflow as tf
logdir = "/tmp/checkpoints"
def get_variables(logdir):
variables = {}