以前のMBPではNVIDIAのGPUが搭載されていました。
そのうちの一つがMBP Retina Mid 2012です。この機種にはNVIDIAのGeForce GT 650M
が搭載されており、CUDA Capability
は3.0
と今となっては古いながらもCUDAが動作するようでした。
昨今GPUといえばGPGPU、とにもかくにも機械学習ということでPyTorchをGPUで動かせるか?ということを調べました。
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
{ | |
"title": "AquaSKK", | |
"rules": [ | |
{ | |
"description": "Ctrl-J to Kana on Apple Terminal/iTerm2", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "j", |
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
error_log logs/error.log error; | |
http { | |
access_log logs/access.log combined; | |
server { | |
listen 8081; | |
root /tmp/; | |
} | |
server { | |
listen 8080; |
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
$ python inheritance.py | |
At SuperClass.echo: SuperClass | |
---------- | |
Before calling super at AClass.echo: AClass | |
At SuperClass.echo: AClass | |
After calling super at AClass.echo: AClass | |
---------- | |
Before calling super at BClass.echo: BClass | |
At SuperClass.echo: BClass | |
After calling super at BClass.echo: BClass |
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 shutil | |
import os | |
import sys | |
import pickle | |
from dropbox.rest import ErrorResponse | |
STATE_FILE = '.dropbox_state' | |
REMOTE_ROOT_PATH = '/Apps/my-pythonista-app' # sync root in dropbox where code is |
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
# coding: utf-8 | |
import ui | |
v = ui.load_view('Untitled') | |
i = 0 | |
lbl = v['label1'] | |
def btn_action(sender): | |
global i |
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
% python passing_queue_like_go.py | |
Traceback (most recent call last): | |
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/queues.py", line 266 | |
, in _feed | |
send(obj) | |
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/queues.py", line 77, | |
in __getstate__ | |
assert_spawning(self) | |
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/forking.py", line 52 | |
, in assert_spawning |
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 [1]: from sqlalchemy import create_engine | |
In [2]: postgresql_engine = create_engine('postgresql://') | |
In [3]: mysql_engine = create_engine('mysql://') | |
In [4]: from myapp.resources import Event | |
In [5]: from sqlalchemy.schema import CreateTable |
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 __future__ import print_function | |
import os | |
import sys | |
import pygit2 | |
import coverage | |
def collect_addition(hunk): | |
result = [] |
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 os | |
import subprocess | |
def kill_children_process(pid, force=False): | |
pid = int(pid) | |
for line in subprocess.check_output( | |
'/bin/ps -eo "ppid pid"', | |
shell=True).split('\n')[1:]: | |
line = line.strip() |
NewerOlder