Skip to content

Instantly share code, notes, and snippets.

@martinloretzzz
martinloretzzz / ttn.d.ts
Created March 20, 2020 15:14
Typescript Definition from The Things Network Http Integration
// https://www.thethingsnetwork.org/docs/applications/http/
export interface TTNHttpMessage {
app_id: string;
dev_id: string;
hardware_serial: string;
port: number;
counter: number;
is_retry: boolean;
confirmed: boolean;
payload_raw: string;
@martinloretzzz
martinloretzzz / tt_eltwise_sfpu.py
Created April 13, 2025 01:56
Tenstorrent eltwise_sfpu in python using cppyy
# This is a python implementation of the eltwise_sfpu example from tt-metal
# Python accesses the C++ API of tt-metalium using cppyy
# C++ source this is based on: https://github.com/tenstorrent/tt-metal/blob/main/tt_metal/programming_examples/eltwise_sfpu/eltwise_sfpu.cpp
# Tutorial: https://docs.tenstorrent.com/tt-metal/latest/tt-metalium/tt_metal/examples/eltwise_sfpu.html
import os
os.environ["TT_METAL_HOME"] = "/root/tt-metal/"
os.environ["ARCH_NAME"] = "wormhole_b0"
import numpy as np