This file contains 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 3.11.8 (main, Feb 6 2024, 21:21:21) [GCC 13.2.0] on linux | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import jax | |
2024-04-08 22:23:25.127712: E external/xla/xla/stream_executor/plugin_registry.cc:91] Invalid plugin kind specified: DNN | |
>>> X = jax.numpy.zeros((5000, 6000)) | |
:1:hip_code_object.cpp :516 : 809713991079 us: [pid:3362424 tid:0x7ffff7eaf740] hipErrorNoBinaryForGpu: Unable to find code object for all current devices! | |
:1:hip_code_object.cpp :517 : 809713991085 us: [pid:3362424 tid:0x7ffff7eaf740] Devices: | |
:1:hip_code_object.cpp :520 : 809713991086 us: [pid:3362424 tid:0x7ffff7eaf740] amdgcn-amd-amdhsa--gfx1100 - [Not Found] | |
:1:hip_code_object.cpp :524 : 809713991091 us: [pid:3362424 tid:0x7ffff7eaf740] Bundled Code Objects: | |
:1:hip_code_object.cpp :540 : 809713991092 us: [pid:3362424 tid:0x7ffff7eaf740] host-x86_64-unknown-linux-- - [Unsupported] |
This file contains 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
"""Demo of how to pop up plots asynchronously using separate processes.""" | |
from multiprocessing import Process | |
import time | |
import sys | |
import matplotlib.pyplot as plt | |
import numpy as np | |
def demo(): | |
i = 0 | |
processes = [] |
This file contains 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 2024 Google LLC. | |
# SPDX-License-Identifier: Apache-2.0 | |
{ | |
description = "Demo of generating a YAML file as a flake output"; | |
outputs = { self, nixpkgs }: let | |
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed; | |
in { | |
packages = forAllSystems (system: | |
let pkgs = nixpkgs.legacyPackages.${system}; | |
in { |
This file contains 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
/* Demonstrates breaking up a string in much the same manner as is done by | |
* the standard library function strtok. It's also an actually practical | |
* occurrence of a triple pointer (char ***). | |
* | |
* Prepared for tutorial purposes by David Warde-Farley, CSC209H Winter 2008 | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> |
This file contains 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
""" | |
L1-penalized minimization using the feature sign search algorithm. | |
""" | |
import logging | |
import numpy as np | |
log = logging.getLogger("feature_sign") | |
log.setLevel(logging.INFO) | |
This file contains 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
""" | |
Simple script I whipped up to dump MSN Messenger logs in XML to a readable | |
plaintext format. It's not very robust, nor am I sure which versions of MSN | |
Messenger it's compatible or incompatible with; I just had a specific | |
conversation I wanted to read, and this was the vehicle to that end. | |
By David Warde-Farley -- user AT cs dot toronto dot edu (user = dwf) | |
Redistributable under the terms of the 3-clause BSD license | |
(see http://www.opensource.org/licenses/bsd-license.php for details) |
This file contains 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 numpy as np | |
import scipy.ndimage as ndimage | |
import matplotlib | |
import matplotlib.pyplot as plt | |
def frac_eq_to(image, value=0): | |
return (image == value).sum() / float(np.prod(image.shape)) | |
def extract_patches(image, patchshape, overlap_allowed=0.5, cropvalue=None, |
This file contains 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 2022 Google LLC. | |
# SPDX-License-Identifier: Apache-2.0 | |
# | |
# Makefile for flashing a nanoCUL stick with evofw3 using arduino-cli. | |
# | |
# Get arduino-cli and make with `nix shell nixpkgs#gnumake nixpkgs#arduino-cli`. | |
# Then run make -f flash-nanocul.mk. | |
# One of atmega328p, atmega32u4. Only tested with atmega328p, the one I have. | |
BOARD=atmega328p |
This file contains 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
""" | |
Example of how to read a partial NumPy array stored in NPY | |
format off of disk. | |
""" | |
__author__ = "David Warde-Farley" | |
__copyright__ = "Copyright (c) 2012 by " + __author__ | |
__license__ = "3-clause BSD" | |
__email__ = "dwf@dwf.name" | |
import struct |
This file contains 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
#!/usr/bin/env python | |
# Copyright (c) 2009, David Warde-Farley | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions | |
# are met: | |
# 1. Redistributions of source code must retain the above copyright | |
# notice, this list of conditions and the following disclaimer. |
NewerOlder