Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Removes dependency to pyquickhelper#34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
sdpython merged 5 commits intomainfrompyq
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion_doc/conf.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -54,7 +54,7 @@

# The following is used by sphinx.ext.linkcode to provide links to github
linkcode_resolve = make_linkcode_resolve(
"mlstatpy",
"onnx-array-api",
(
"https://github.com/sdpython/onnx-array-api/"
"blob/{revision}/{package}/"
Expand DownExpand Up@@ -114,6 +114,7 @@
"https://data-apis.org/array-api/",
("2022.12/API_specification/generated/array_api.{0}.html", 1),
),
"cProfile.Profile": "https://docs.python.org/3/library/profile.html#profile.Profile",
"DOT": "https://graphviz.org/doc/info/lang.html",
"JIT": "https://en.wikipedia.org/wiki/Just-in-time_compilation",
"onnx": "https://onnx.ai/onnx/",
Expand Down
2 changes: 1 addition & 1 deletion_doc/examples/plot_benchmark_rf.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,7 +25,7 @@
from onnxmltools.convert.xgboost.operator_converters.XGBoost import convert_xgboost
from onnxruntime import InferenceSession, SessionOptions
from psutil import cpu_count
frompyquickhelper.loghelper import run_cmd
fromsphinx_runpython.runpython import run_cmd
from skl2onnx import to_onnx, update_registered_converter
from skl2onnx.common.shape_calculator import calculate_linear_regressor_output_shapes
from sklearn import set_config
Expand Down
2 changes: 1 addition & 1 deletion_doc/examples/plot_onnxruntime.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,7 +45,7 @@ def myloss(x, y):
###############################
# Profiling
# +++++++++
frompyquickhelper.pycode.profiling import profile, profile2graph
fromonnx_array_api.profiling import profile, profile2graph

x = np.random.randn(10000, 2).astype(np.float32)
y = np.random.randn(10000, 2).astype(np.float32)
Expand Down
20 changes: 12 additions & 8 deletionsonnx_array_api/profiling.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -491,7 +491,7 @@ def profile2df(
::

import pstats
frompyquickhelper.pycode.profiling import profile2df
fromonnx_array_api.profiling import profile2df

ps = pstats.Stats('bench_ortmodule_nn_gpu6.prof')
df = profile2df(pd)
Expand DownExpand Up@@ -519,7 +519,7 @@ def profile(
sort: str = "cumulative",
rootrem: Optional[str] = None,
as_df: bool = False,
return_results=False,
return_results: bool =False,
**kwargs,
) -> str:
"""
Expand All@@ -532,17 +532,22 @@ def profile(
:param as_df: return the results as a dataframe and not text
:param return_results: if True, return results as well
(in the first position)
:param kwargs: additional parameters used to create the profiler
:param kwargs: additional parameters used to create the profiler,
see :epkg:`cProfile.Profile`
:return: raw results, statistics text dump (or dataframe is *as_df* is True)

.. plot::

import matplotlib.pyplot as plt
from pyquickhelper.pycode.profiling import profile
from pyquickhelper.texthelper import compare_module_version
from onnx_array_api.profiling import profile

def subf(x):
return sum(x)

def fctm():
return compare_module_version('0.20.4', '0.22.dev0')
x1 = subf([1, 2, 3])
x2 = subf([1, 2, 3, 4])
return x1 + x2

pr, df = profile(lambda: [fctm() for i in range(0, 1000)], as_df=True)
ax = df[['namefct', 'cum_tall']].head(n=15).set_index(
Expand DownExpand Up@@ -585,8 +590,7 @@ def clean_text(res):
res = res.replace(sub[0], sub[1])
else:
raise TypeError(
"rootrem must contains strings or tuple not {0}"
".".format(rootrem)
f"rootrem must contains strings or tuple not {rootrem!r}."
)
return res

Expand Down
1 change: 0 additions & 1 deletionrequirements-dev.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,6 @@ openpyxl
packaging
pandas
psutil
pyquickhelper
pytest
pytest-cov
rstcheck[sphinx,toml]
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp