Skip to content

Instantly share code, notes, and snippets.

@asmeurer
asmeurer / grammar-checker-gpt-prompt.txt
Last active April 12, 2024 22:11
Grammar Checker GPT Prompt
https://chat.openai.com/g/g-E9aHgMUwv-grammar-checker-gpt
=========================================================================== test session starts ===========================================================================
platform darwin -- Python 3.11.7, pytest-8.0.0, pluggy-1.4.0
rootdir: /Users/aaronmeurer/Documents/array-api-tests
configfile: pytest.ini
plugins: pudb-0.7.0, hypothesis-6.99.2, json-report-1.5.0, cov-4.1.0, doctestplus-1.1.0, typeguard-4.1.5, flakes-4.0.5
collected 27 items / 26 deselected / 1 selected
array_api_tests/test_linalg.py F [100%]
================================================================================ FAILURES =================================================================================
import torch
from torch.testing import make_tensor
from torch.fx.experimental.proxy_tensor import make_fx
from torch.utils.benchmark import Timer, Compare
from torch._inductor.compile_fx import compile_fx_inner, cudagraphify_impl
from torch._inductor.decomposition import decompositions
from itertools import product
import numpy as np
@asmeurer
asmeurer / sympy-gpt-prompt
Last active January 11, 2024 01:56
SymPy GPT prompt
You are a specialized GPT designed to assist users with the SymPy Python library. Your primary function is to help users understand and utilize SymPy for their mathematical and symbolic computation needs. You are equipped with the ability to execute Python code, particularly focusing on SymPy. Before executing any code, you will always install the latest version of SymPy provided by the user as a wheel file. Additionally, you have access to a PDF of SymPy's documentation, which you can reference to provide accurate and detailed explanations. You are knowledgeable in Python and SymPy, capable of solving a wide range of mathematical problems and offering code examples and explanations. If you are presented with a mathematical question, you should write code using SymPy to solve the problem. If you find that a problem cannot be solved by SymPy, you may suggest alternative Python libraries to solve the problem. Remember that the point is not just to solve people's problems for them, but to teach them how to use
@asmeurer
asmeurer / duplicate negative index handling
Last active November 30, 2023 23:01
take decomposition benchmark
(262144,)
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] Output code:
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG]
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] from ctypes import c_void_p, c_long
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] import torch
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] import math
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] import random
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] import os
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] import tempfile
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] from math import inf, nan
@asmeurer
asmeurer / .gitignore
Last active November 14, 2023 01:34
SymPy Contribution Stats
.ipynb_checkpoints/
@asmeurer
asmeurer / fn4.py
Created October 23, 2023 21:45
fn4
def inner_fn(index):
i0, i1 = index
tmp0 = ops.index_expr(i1, dtype=torch.int64)
tmp1 = ops.to_dtype(tmp0, torch.float32, src_dtype=torch.int64)
tmp2 = ops.constant(225.0, torch.float32)
tmp3 = tmp1 < tmp2
tmp4 = ops.index_expr(i1, dtype=torch.int64)
tmp5 = ops.to_dtype(tmp4, torch.float32, src_dtype=torch.int64)
tmp6 = ops.constant(0.0066815144766146995, torch.float32)
tmp7 = tmp5 * tmp6
@asmeurer
asmeurer / svg2pdf.bash
Last active August 18, 2023 12:02 — forked from s417-lama/svg2pdf.bash
Reliable way to convert an SVG file to a PDF file using headless Chrome
#!/bin/bash
#
# Convert an SVG file to a PDF file by using headless Chrome.
#
if [ $# -ne 2 ]; then
echo "Usage: ./svg2pdf.bash input.svg output.pdf" 1>&2
exit 1
fi
^CYou can add @seed(209619979639939998162824709723232908623) to this test or run pytest with --hypothesis-seed=209619979639939998162824709723232908623 to reproduce this failure.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! KeyboardInterrupt !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
config = <_pytest.config.Config object at 0x7ff694b54a90>, doit = <function _main at 0x7ff692e01c10>
def wrap_session(
config: Config, doit: Callable[[Config, "Session"], Optional[Union[int, ExitCode]]]
) -> Union[int, ExitCode]:
"""Skeleton command line program."""
>>> import scipy.signal
>>> import cupy
>>> x = cupy.zeros((50_000_000,))
>>> x[10] = 1.
>>> scipy.signal.welch(x)
Traceback (most recent call last):