Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Latest commit

 

History

History
History
47 lines (36 loc) · 921 Bytes

File metadata and controls

47 lines (36 loc) · 921 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from os import getenv
import numpy
import sharpy
from sharpy.numpy import fromfunction
sharpy.fromfunction = fromfunction
device = getenv("SHARPY_DEVICE", "")
def runAndCompare(func, do_gather=True):
aa = func(sharpy, device=device)
a = sharpy.spmd.gather(aa) if do_gather else aa
b = func(numpy)
if isinstance(b, numpy.ndarray):
return a.shape == b.shape and numpy.allclose(a, b, rtol=1e-8, atol=1e-8)
return float(a) == float(b)
mpi_dtypes = [
sharpy.float32,
sharpy.int32,
sharpy.uint32,
]
if len(device) == 0:
mpi_dtypes += [
sharpy.float64,
sharpy.int64,
sharpy.uint64,
sharpy.int8,
sharpy.uint8,
]
def dtypeIsInt(dtype):
mpi_int_types = [
sharpy.int8,
sharpy.int32,
sharpy.int64,
sharpy.uint8,
sharpy.uint32,
sharpy.uint64,
]
return dtype in mpi_int_types
Morty Proxy This is a proxified and sanitized view of the page, visit original site.