Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- mantis_evalkit/lib/python3.10/site-packages/portalocker-3.1.1.dist-info/LICENSE +11 -0
- mantis_evalkit/lib/python3.10/site-packages/portalocker-3.1.1.dist-info/top_level.txt +1 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/__pycache__/__init__.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/__pycache__/__main__.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/__pycache__/_bdist_wheel.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/__pycache__/_setuptools_logging.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/__pycache__/bdist_wheel.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/__pycache__/macosx_libfile.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/__pycache__/metadata.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/__pycache__/util.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/__pycache__/wheelfile.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/cli/__init__.py +155 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/cli/__pycache__/convert.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/cli/__pycache__/tags.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/cli/__pycache__/unpack.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/cli/convert.py +332 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/cli/pack.py +85 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/cli/tags.py +139 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/cli/unpack.py +30 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/__pycache__/__init__.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/__init__.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/_elffile.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/_manylinux.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/_musllinux.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/_parser.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/_tokenizer.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/markers.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/specifiers.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/tags.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/utils.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/version.cpython-310.pyc +0 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/_manylinux.py +260 -0
- mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/_structures.py +61 -0
- moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_aminmax.h +53 -0
- moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_assert_tensor_metadata.h +47 -0
- moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_autocast_to_reduced_precision.h +26 -0
- moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_convert_indices_from_coo_to_csr_ops.h +39 -0
- moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_foreach_log10_cuda_dispatch.h +24 -0
- moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_fused_adam_compositeexplicitautograd_dispatch.h +28 -0
- moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_make_dual_ops.h +28 -0
- moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_masked_softmax.h +39 -0
- moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_masked_softmax_backward_native.h +23 -0
- moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_nested_select_backward_ops.h +28 -0
- moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_segment_reduce_backward.h +39 -0
- moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_unsafe_index_put_ops.h +28 -0
- moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_upsample_bicubic2d_aa_ops.h +50 -0
- moondream/lib/python3.10/site-packages/torch/include/ATen/ops/addmv_cuda_dispatch.h +26 -0
- moondream/lib/python3.10/site-packages/torch/include/ATen/ops/argmin_native.h +23 -0
- moondream/lib/python3.10/site-packages/torch/include/ATen/ops/asin_ops.h +50 -0
- moondream/lib/python3.10/site-packages/torch/include/ATen/ops/col_indices_ops.h +28 -0
mantis_evalkit/lib/python3.10/site-packages/portalocker-3.1.1.dist-info/LICENSE
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Copyright 2022 Rick van Hattem
|
| 2 |
+
|
| 3 |
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
| 4 |
+
|
| 5 |
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
| 6 |
+
|
| 7 |
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
| 8 |
+
|
| 9 |
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
| 10 |
+
|
| 11 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
mantis_evalkit/lib/python3.10/site-packages/portalocker-3.1.1.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
portalocker
|
mantis_evalkit/lib/python3.10/site-packages/wheel/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (212 Bytes). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/__pycache__/__main__.cpython-310.pyc
ADDED
|
Binary file (610 Bytes). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/__pycache__/_bdist_wheel.cpython-310.pyc
ADDED
|
Binary file (15.2 kB). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/__pycache__/_setuptools_logging.cpython-310.pyc
ADDED
|
Binary file (998 Bytes). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/__pycache__/bdist_wheel.cpython-310.pyc
ADDED
|
Binary file (672 Bytes). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/__pycache__/macosx_libfile.cpython-310.pyc
ADDED
|
Binary file (10.4 kB). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/__pycache__/metadata.cpython-310.pyc
ADDED
|
Binary file (6.17 kB). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/__pycache__/util.cpython-310.pyc
ADDED
|
Binary file (693 Bytes). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/__pycache__/wheelfile.cpython-310.pyc
ADDED
|
Binary file (6.48 kB). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/cli/__init__.py
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Wheel command-line utility.
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
from __future__ import annotations
|
| 6 |
+
|
| 7 |
+
import argparse
|
| 8 |
+
import os
|
| 9 |
+
import sys
|
| 10 |
+
from argparse import ArgumentTypeError
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class WheelError(Exception):
|
| 14 |
+
pass
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def unpack_f(args: argparse.Namespace) -> None:
|
| 18 |
+
from .unpack import unpack
|
| 19 |
+
|
| 20 |
+
unpack(args.wheelfile, args.dest)
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def pack_f(args: argparse.Namespace) -> None:
|
| 24 |
+
from .pack import pack
|
| 25 |
+
|
| 26 |
+
pack(args.directory, args.dest_dir, args.build_number)
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def convert_f(args: argparse.Namespace) -> None:
|
| 30 |
+
from .convert import convert
|
| 31 |
+
|
| 32 |
+
convert(args.files, args.dest_dir, args.verbose)
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def tags_f(args: argparse.Namespace) -> None:
|
| 36 |
+
from .tags import tags
|
| 37 |
+
|
| 38 |
+
names = (
|
| 39 |
+
tags(
|
| 40 |
+
wheel,
|
| 41 |
+
args.python_tag,
|
| 42 |
+
args.abi_tag,
|
| 43 |
+
args.platform_tag,
|
| 44 |
+
args.build,
|
| 45 |
+
args.remove,
|
| 46 |
+
)
|
| 47 |
+
for wheel in args.wheel
|
| 48 |
+
)
|
| 49 |
+
|
| 50 |
+
for name in names:
|
| 51 |
+
print(name)
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
def version_f(args: argparse.Namespace) -> None:
|
| 55 |
+
from .. import __version__
|
| 56 |
+
|
| 57 |
+
print(f"wheel {__version__}")
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
def parse_build_tag(build_tag: str) -> str:
|
| 61 |
+
if build_tag and not build_tag[0].isdigit():
|
| 62 |
+
raise ArgumentTypeError("build tag must begin with a digit")
|
| 63 |
+
elif "-" in build_tag:
|
| 64 |
+
raise ArgumentTypeError("invalid character ('-') in build tag")
|
| 65 |
+
|
| 66 |
+
return build_tag
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
TAGS_HELP = """\
|
| 70 |
+
Make a new wheel with given tags. Any tags unspecified will remain the same.
|
| 71 |
+
Starting the tags with a "+" will append to the existing tags. Starting with a
|
| 72 |
+
"-" will remove a tag (use --option=-TAG syntax). Multiple tags can be
|
| 73 |
+
separated by ".". The original file will remain unless --remove is given. The
|
| 74 |
+
output filename(s) will be displayed on stdout for further processing.
|
| 75 |
+
"""
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
def parser():
|
| 79 |
+
p = argparse.ArgumentParser()
|
| 80 |
+
s = p.add_subparsers(help="commands")
|
| 81 |
+
|
| 82 |
+
unpack_parser = s.add_parser("unpack", help="Unpack wheel")
|
| 83 |
+
unpack_parser.add_argument(
|
| 84 |
+
"--dest", "-d", help="Destination directory", default="."
|
| 85 |
+
)
|
| 86 |
+
unpack_parser.add_argument("wheelfile", help="Wheel file")
|
| 87 |
+
unpack_parser.set_defaults(func=unpack_f)
|
| 88 |
+
|
| 89 |
+
repack_parser = s.add_parser("pack", help="Repack wheel")
|
| 90 |
+
repack_parser.add_argument("directory", help="Root directory of the unpacked wheel")
|
| 91 |
+
repack_parser.add_argument(
|
| 92 |
+
"--dest-dir",
|
| 93 |
+
"-d",
|
| 94 |
+
default=os.path.curdir,
|
| 95 |
+
help="Directory to store the wheel (default %(default)s)",
|
| 96 |
+
)
|
| 97 |
+
repack_parser.add_argument(
|
| 98 |
+
"--build-number", help="Build tag to use in the wheel name"
|
| 99 |
+
)
|
| 100 |
+
repack_parser.set_defaults(func=pack_f)
|
| 101 |
+
|
| 102 |
+
convert_parser = s.add_parser("convert", help="Convert egg or wininst to wheel")
|
| 103 |
+
convert_parser.add_argument("files", nargs="*", help="Files to convert")
|
| 104 |
+
convert_parser.add_argument(
|
| 105 |
+
"--dest-dir",
|
| 106 |
+
"-d",
|
| 107 |
+
default=os.path.curdir,
|
| 108 |
+
help="Directory to store wheels (default %(default)s)",
|
| 109 |
+
)
|
| 110 |
+
convert_parser.add_argument("--verbose", "-v", action="store_true")
|
| 111 |
+
convert_parser.set_defaults(func=convert_f)
|
| 112 |
+
|
| 113 |
+
tags_parser = s.add_parser(
|
| 114 |
+
"tags", help="Add or replace the tags on a wheel", description=TAGS_HELP
|
| 115 |
+
)
|
| 116 |
+
tags_parser.add_argument("wheel", nargs="*", help="Existing wheel(s) to retag")
|
| 117 |
+
tags_parser.add_argument(
|
| 118 |
+
"--remove",
|
| 119 |
+
action="store_true",
|
| 120 |
+
help="Remove the original files, keeping only the renamed ones",
|
| 121 |
+
)
|
| 122 |
+
tags_parser.add_argument(
|
| 123 |
+
"--python-tag", metavar="TAG", help="Specify an interpreter tag(s)"
|
| 124 |
+
)
|
| 125 |
+
tags_parser.add_argument("--abi-tag", metavar="TAG", help="Specify an ABI tag(s)")
|
| 126 |
+
tags_parser.add_argument(
|
| 127 |
+
"--platform-tag", metavar="TAG", help="Specify a platform tag(s)"
|
| 128 |
+
)
|
| 129 |
+
tags_parser.add_argument(
|
| 130 |
+
"--build", type=parse_build_tag, metavar="BUILD", help="Specify a build tag"
|
| 131 |
+
)
|
| 132 |
+
tags_parser.set_defaults(func=tags_f)
|
| 133 |
+
|
| 134 |
+
version_parser = s.add_parser("version", help="Print version and exit")
|
| 135 |
+
version_parser.set_defaults(func=version_f)
|
| 136 |
+
|
| 137 |
+
help_parser = s.add_parser("help", help="Show this help")
|
| 138 |
+
help_parser.set_defaults(func=lambda args: p.print_help())
|
| 139 |
+
|
| 140 |
+
return p
|
| 141 |
+
|
| 142 |
+
|
| 143 |
+
def main():
|
| 144 |
+
p = parser()
|
| 145 |
+
args = p.parse_args()
|
| 146 |
+
if not hasattr(args, "func"):
|
| 147 |
+
p.print_help()
|
| 148 |
+
else:
|
| 149 |
+
try:
|
| 150 |
+
args.func(args)
|
| 151 |
+
return 0
|
| 152 |
+
except WheelError as e:
|
| 153 |
+
print(e, file=sys.stderr)
|
| 154 |
+
|
| 155 |
+
return 1
|
mantis_evalkit/lib/python3.10/site-packages/wheel/cli/__pycache__/convert.cpython-310.pyc
ADDED
|
Binary file (9.61 kB). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/cli/__pycache__/tags.cpython-310.pyc
ADDED
|
Binary file (3.83 kB). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/cli/__pycache__/unpack.cpython-310.pyc
ADDED
|
Binary file (1.08 kB). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/cli/convert.py
ADDED
|
@@ -0,0 +1,332 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import os.path
|
| 4 |
+
import re
|
| 5 |
+
from abc import ABCMeta, abstractmethod
|
| 6 |
+
from collections import defaultdict
|
| 7 |
+
from collections.abc import Iterator
|
| 8 |
+
from email.message import Message
|
| 9 |
+
from email.parser import Parser
|
| 10 |
+
from email.policy import EmailPolicy
|
| 11 |
+
from glob import iglob
|
| 12 |
+
from pathlib import Path
|
| 13 |
+
from textwrap import dedent
|
| 14 |
+
from zipfile import ZipFile
|
| 15 |
+
|
| 16 |
+
from .. import __version__
|
| 17 |
+
from ..metadata import generate_requirements
|
| 18 |
+
from ..vendored.packaging.tags import parse_tag
|
| 19 |
+
from ..wheelfile import WheelFile
|
| 20 |
+
|
| 21 |
+
egg_filename_re = re.compile(
|
| 22 |
+
r"""
|
| 23 |
+
(?P<name>.+?)-(?P<ver>.+?)
|
| 24 |
+
(-(?P<pyver>py\d\.\d+)
|
| 25 |
+
(-(?P<arch>.+?))?
|
| 26 |
+
)?.egg$""",
|
| 27 |
+
re.VERBOSE,
|
| 28 |
+
)
|
| 29 |
+
egg_info_re = re.compile(
|
| 30 |
+
r"""
|
| 31 |
+
^(?P<name>.+?)-(?P<ver>.+?)
|
| 32 |
+
(-(?P<pyver>py\d\.\d+)
|
| 33 |
+
)?.egg-info/""",
|
| 34 |
+
re.VERBOSE,
|
| 35 |
+
)
|
| 36 |
+
wininst_re = re.compile(
|
| 37 |
+
r"\.(?P<platform>win32|win-amd64)(?:-(?P<pyver>py\d\.\d))?\.exe$"
|
| 38 |
+
)
|
| 39 |
+
pyd_re = re.compile(r"\.(?P<abi>[a-z0-9]+)-(?P<platform>win32|win_amd64)\.pyd$")
|
| 40 |
+
serialization_policy = EmailPolicy(
|
| 41 |
+
utf8=True,
|
| 42 |
+
mangle_from_=False,
|
| 43 |
+
max_line_length=0,
|
| 44 |
+
)
|
| 45 |
+
GENERATOR = f"wheel {__version__}"
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
def convert_requires(requires: str, metadata: Message) -> None:
|
| 49 |
+
extra: str | None = None
|
| 50 |
+
requirements: dict[str | None, list[str]] = defaultdict(list)
|
| 51 |
+
for line in requires.splitlines():
|
| 52 |
+
line = line.strip()
|
| 53 |
+
if not line:
|
| 54 |
+
continue
|
| 55 |
+
|
| 56 |
+
if line.startswith("[") and line.endswith("]"):
|
| 57 |
+
extra = line[1:-1]
|
| 58 |
+
continue
|
| 59 |
+
|
| 60 |
+
requirements[extra].append(line)
|
| 61 |
+
|
| 62 |
+
for key, value in generate_requirements(requirements):
|
| 63 |
+
metadata.add_header(key, value)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
def convert_pkg_info(pkginfo: str, metadata: Message):
|
| 67 |
+
parsed_message = Parser().parsestr(pkginfo)
|
| 68 |
+
for key, value in parsed_message.items():
|
| 69 |
+
key_lower = key.lower()
|
| 70 |
+
if value == "UNKNOWN":
|
| 71 |
+
continue
|
| 72 |
+
|
| 73 |
+
if key_lower == "description":
|
| 74 |
+
description_lines = value.splitlines()
|
| 75 |
+
value = "\n".join(
|
| 76 |
+
(
|
| 77 |
+
description_lines[0].lstrip(),
|
| 78 |
+
dedent("\n".join(description_lines[1:])),
|
| 79 |
+
"\n",
|
| 80 |
+
)
|
| 81 |
+
)
|
| 82 |
+
metadata.set_payload(value)
|
| 83 |
+
elif key_lower == "home-page":
|
| 84 |
+
metadata.add_header("Project-URL", f"Homepage, {value}")
|
| 85 |
+
elif key_lower == "download-url":
|
| 86 |
+
metadata.add_header("Project-URL", f"Download, {value}")
|
| 87 |
+
else:
|
| 88 |
+
metadata.add_header(key, value)
|
| 89 |
+
|
| 90 |
+
metadata.replace_header("Metadata-Version", "2.4")
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
def normalize(name: str) -> str:
|
| 94 |
+
return re.sub(r"[-_.]+", "-", name).lower().replace("-", "_")
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
class ConvertSource(metaclass=ABCMeta):
|
| 98 |
+
name: str
|
| 99 |
+
version: str
|
| 100 |
+
pyver: str = "py2.py3"
|
| 101 |
+
abi: str = "none"
|
| 102 |
+
platform: str = "any"
|
| 103 |
+
metadata: Message
|
| 104 |
+
|
| 105 |
+
@property
|
| 106 |
+
def dist_info_dir(self) -> str:
|
| 107 |
+
return f"{self.name}-{self.version}.dist-info"
|
| 108 |
+
|
| 109 |
+
@abstractmethod
|
| 110 |
+
def generate_contents(self) -> Iterator[tuple[str, bytes]]:
|
| 111 |
+
pass
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
class EggFileSource(ConvertSource):
|
| 115 |
+
def __init__(self, path: Path):
|
| 116 |
+
if not (match := egg_filename_re.match(path.name)):
|
| 117 |
+
raise ValueError(f"Invalid egg file name: {path.name}")
|
| 118 |
+
|
| 119 |
+
# Binary wheels are assumed to be for CPython
|
| 120 |
+
self.path = path
|
| 121 |
+
self.name = normalize(match.group("name"))
|
| 122 |
+
self.version = match.group("ver")
|
| 123 |
+
if pyver := match.group("pyver"):
|
| 124 |
+
self.pyver = pyver.replace(".", "")
|
| 125 |
+
if arch := match.group("arch"):
|
| 126 |
+
self.abi = self.pyver.replace("py", "cp")
|
| 127 |
+
self.platform = normalize(arch)
|
| 128 |
+
|
| 129 |
+
self.metadata = Message()
|
| 130 |
+
|
| 131 |
+
def generate_contents(self) -> Iterator[tuple[str, bytes]]:
|
| 132 |
+
with ZipFile(self.path, "r") as zip_file:
|
| 133 |
+
for filename in sorted(zip_file.namelist()):
|
| 134 |
+
# Skip pure directory entries
|
| 135 |
+
if filename.endswith("/"):
|
| 136 |
+
continue
|
| 137 |
+
|
| 138 |
+
# Handle files in the egg-info directory specially, selectively moving
|
| 139 |
+
# them to the dist-info directory while converting as needed
|
| 140 |
+
if filename.startswith("EGG-INFO/"):
|
| 141 |
+
if filename == "EGG-INFO/requires.txt":
|
| 142 |
+
requires = zip_file.read(filename).decode("utf-8")
|
| 143 |
+
convert_requires(requires, self.metadata)
|
| 144 |
+
elif filename == "EGG-INFO/PKG-INFO":
|
| 145 |
+
pkginfo = zip_file.read(filename).decode("utf-8")
|
| 146 |
+
convert_pkg_info(pkginfo, self.metadata)
|
| 147 |
+
elif filename == "EGG-INFO/entry_points.txt":
|
| 148 |
+
yield (
|
| 149 |
+
f"{self.dist_info_dir}/entry_points.txt",
|
| 150 |
+
zip_file.read(filename),
|
| 151 |
+
)
|
| 152 |
+
|
| 153 |
+
continue
|
| 154 |
+
|
| 155 |
+
# For any other file, just pass it through
|
| 156 |
+
yield filename, zip_file.read(filename)
|
| 157 |
+
|
| 158 |
+
|
| 159 |
+
class EggDirectorySource(EggFileSource):
|
| 160 |
+
def generate_contents(self) -> Iterator[tuple[str, bytes]]:
|
| 161 |
+
for dirpath, _, filenames in os.walk(self.path):
|
| 162 |
+
for filename in sorted(filenames):
|
| 163 |
+
path = Path(dirpath, filename)
|
| 164 |
+
if path.parent.name == "EGG-INFO":
|
| 165 |
+
if path.name == "requires.txt":
|
| 166 |
+
requires = path.read_text("utf-8")
|
| 167 |
+
convert_requires(requires, self.metadata)
|
| 168 |
+
elif path.name == "PKG-INFO":
|
| 169 |
+
pkginfo = path.read_text("utf-8")
|
| 170 |
+
convert_pkg_info(pkginfo, self.metadata)
|
| 171 |
+
if name := self.metadata.get("Name"):
|
| 172 |
+
self.name = normalize(name)
|
| 173 |
+
|
| 174 |
+
if version := self.metadata.get("Version"):
|
| 175 |
+
self.version = version
|
| 176 |
+
elif path.name == "entry_points.txt":
|
| 177 |
+
yield (
|
| 178 |
+
f"{self.dist_info_dir}/entry_points.txt",
|
| 179 |
+
path.read_bytes(),
|
| 180 |
+
)
|
| 181 |
+
|
| 182 |
+
continue
|
| 183 |
+
|
| 184 |
+
# For any other file, just pass it through
|
| 185 |
+
yield str(path.relative_to(self.path)), path.read_bytes()
|
| 186 |
+
|
| 187 |
+
|
| 188 |
+
class WininstFileSource(ConvertSource):
|
| 189 |
+
"""
|
| 190 |
+
Handles distributions created with ``bdist_wininst``.
|
| 191 |
+
|
| 192 |
+
The egginfo filename has the format::
|
| 193 |
+
|
| 194 |
+
name-ver(-pyver)(-arch).egg-info
|
| 195 |
+
|
| 196 |
+
The installer filename has the format::
|
| 197 |
+
|
| 198 |
+
name-ver.arch(-pyver).exe
|
| 199 |
+
|
| 200 |
+
Some things to note:
|
| 201 |
+
|
| 202 |
+
1. The installer filename is not definitive. An installer can be renamed
|
| 203 |
+
and work perfectly well as an installer. So more reliable data should
|
| 204 |
+
be used whenever possible.
|
| 205 |
+
2. The egg-info data should be preferred for the name and version, because
|
| 206 |
+
these come straight from the distutils metadata, and are mandatory.
|
| 207 |
+
3. The pyver from the egg-info data should be ignored, as it is
|
| 208 |
+
constructed from the version of Python used to build the installer,
|
| 209 |
+
which is irrelevant - the installer filename is correct here (even to
|
| 210 |
+
the point that when it's not there, any version is implied).
|
| 211 |
+
4. The architecture must be taken from the installer filename, as it is
|
| 212 |
+
not included in the egg-info data.
|
| 213 |
+
5. Architecture-neutral installers still have an architecture because the
|
| 214 |
+
installer format itself (being executable) is architecture-specific. We
|
| 215 |
+
should therefore ignore the architecture if the content is pure-python.
|
| 216 |
+
"""
|
| 217 |
+
|
| 218 |
+
def __init__(self, path: Path):
|
| 219 |
+
self.path = path
|
| 220 |
+
self.metadata = Message()
|
| 221 |
+
|
| 222 |
+
# Determine the initial architecture and Python version from the file name
|
| 223 |
+
# (if possible)
|
| 224 |
+
if match := wininst_re.search(path.name):
|
| 225 |
+
self.platform = normalize(match.group("platform"))
|
| 226 |
+
if pyver := match.group("pyver"):
|
| 227 |
+
self.pyver = pyver.replace(".", "")
|
| 228 |
+
|
| 229 |
+
# Look for an .egg-info directory and any .pyd files for more precise info
|
| 230 |
+
egg_info_found = pyd_found = False
|
| 231 |
+
with ZipFile(self.path) as zip_file:
|
| 232 |
+
for filename in zip_file.namelist():
|
| 233 |
+
prefix, filename = filename.split("/", 1)
|
| 234 |
+
if not egg_info_found and (match := egg_info_re.match(filename)):
|
| 235 |
+
egg_info_found = True
|
| 236 |
+
self.name = normalize(match.group("name"))
|
| 237 |
+
self.version = match.group("ver")
|
| 238 |
+
if pyver := match.group("pyver"):
|
| 239 |
+
self.pyver = pyver.replace(".", "")
|
| 240 |
+
elif not pyd_found and (match := pyd_re.search(filename)):
|
| 241 |
+
pyd_found = True
|
| 242 |
+
self.abi = match.group("abi")
|
| 243 |
+
self.platform = match.group("platform")
|
| 244 |
+
|
| 245 |
+
if egg_info_found and pyd_found:
|
| 246 |
+
break
|
| 247 |
+
|
| 248 |
+
def generate_contents(self) -> Iterator[tuple[str, bytes]]:
|
| 249 |
+
dist_info_dir = f"{self.name}-{self.version}.dist-info"
|
| 250 |
+
data_dir = f"{self.name}-{self.version}.data"
|
| 251 |
+
with ZipFile(self.path, "r") as zip_file:
|
| 252 |
+
for filename in sorted(zip_file.namelist()):
|
| 253 |
+
# Skip pure directory entries
|
| 254 |
+
if filename.endswith("/"):
|
| 255 |
+
continue
|
| 256 |
+
|
| 257 |
+
# Handle files in the egg-info directory specially, selectively moving
|
| 258 |
+
# them to the dist-info directory while converting as needed
|
| 259 |
+
prefix, target_filename = filename.split("/", 1)
|
| 260 |
+
if egg_info_re.search(target_filename):
|
| 261 |
+
basename = target_filename.rsplit("/", 1)[-1]
|
| 262 |
+
if basename == "requires.txt":
|
| 263 |
+
requires = zip_file.read(filename).decode("utf-8")
|
| 264 |
+
convert_requires(requires, self.metadata)
|
| 265 |
+
elif basename == "PKG-INFO":
|
| 266 |
+
pkginfo = zip_file.read(filename).decode("utf-8")
|
| 267 |
+
convert_pkg_info(pkginfo, self.metadata)
|
| 268 |
+
elif basename == "entry_points.txt":
|
| 269 |
+
yield (
|
| 270 |
+
f"{dist_info_dir}/entry_points.txt",
|
| 271 |
+
zip_file.read(filename),
|
| 272 |
+
)
|
| 273 |
+
|
| 274 |
+
continue
|
| 275 |
+
elif prefix == "SCRIPTS":
|
| 276 |
+
target_filename = f"{data_dir}/scripts/{target_filename}"
|
| 277 |
+
|
| 278 |
+
# For any other file, just pass it through
|
| 279 |
+
yield target_filename, zip_file.read(filename)
|
| 280 |
+
|
| 281 |
+
|
| 282 |
+
def convert(files: list[str], dest_dir: str, verbose: bool) -> None:
|
| 283 |
+
for pat in files:
|
| 284 |
+
for archive in iglob(pat):
|
| 285 |
+
path = Path(archive)
|
| 286 |
+
if path.suffix == ".egg":
|
| 287 |
+
if path.is_dir():
|
| 288 |
+
source: ConvertSource = EggDirectorySource(path)
|
| 289 |
+
else:
|
| 290 |
+
source = EggFileSource(path)
|
| 291 |
+
else:
|
| 292 |
+
source = WininstFileSource(path)
|
| 293 |
+
|
| 294 |
+
if verbose:
|
| 295 |
+
print(f"{archive}...", flush=True, end="")
|
| 296 |
+
|
| 297 |
+
dest_path = Path(dest_dir) / (
|
| 298 |
+
f"{source.name}-{source.version}-{source.pyver}-{source.abi}"
|
| 299 |
+
f"-{source.platform}.whl"
|
| 300 |
+
)
|
| 301 |
+
with WheelFile(dest_path, "w") as wheelfile:
|
| 302 |
+
for name_or_zinfo, contents in source.generate_contents():
|
| 303 |
+
wheelfile.writestr(name_or_zinfo, contents)
|
| 304 |
+
|
| 305 |
+
# Write the METADATA file
|
| 306 |
+
wheelfile.writestr(
|
| 307 |
+
f"{source.dist_info_dir}/METADATA",
|
| 308 |
+
source.metadata.as_string(policy=serialization_policy).encode(
|
| 309 |
+
"utf-8"
|
| 310 |
+
),
|
| 311 |
+
)
|
| 312 |
+
|
| 313 |
+
# Write the WHEEL file
|
| 314 |
+
wheel_message = Message()
|
| 315 |
+
wheel_message.add_header("Wheel-Version", "1.0")
|
| 316 |
+
wheel_message.add_header("Generator", GENERATOR)
|
| 317 |
+
wheel_message.add_header(
|
| 318 |
+
"Root-Is-Purelib", str(source.platform == "any").lower()
|
| 319 |
+
)
|
| 320 |
+
tags = parse_tag(f"{source.pyver}-{source.abi}-{source.platform}")
|
| 321 |
+
for tag in sorted(tags, key=lambda tag: tag.interpreter):
|
| 322 |
+
wheel_message.add_header("Tag", str(tag))
|
| 323 |
+
|
| 324 |
+
wheelfile.writestr(
|
| 325 |
+
f"{source.dist_info_dir}/WHEEL",
|
| 326 |
+
wheel_message.as_string(policy=serialization_policy).encode(
|
| 327 |
+
"utf-8"
|
| 328 |
+
),
|
| 329 |
+
)
|
| 330 |
+
|
| 331 |
+
if verbose:
|
| 332 |
+
print("OK")
|
mantis_evalkit/lib/python3.10/site-packages/wheel/cli/pack.py
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import email.policy
|
| 4 |
+
import os.path
|
| 5 |
+
import re
|
| 6 |
+
from email.generator import BytesGenerator
|
| 7 |
+
from email.parser import BytesParser
|
| 8 |
+
|
| 9 |
+
from wheel.cli import WheelError
|
| 10 |
+
from wheel.wheelfile import WheelFile
|
| 11 |
+
|
| 12 |
+
DIST_INFO_RE = re.compile(r"^(?P<namever>(?P<name>.+?)-(?P<ver>\d.*?))\.dist-info$")
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
def pack(directory: str, dest_dir: str, build_number: str | None) -> None:
|
| 16 |
+
"""Repack a previously unpacked wheel directory into a new wheel file.
|
| 17 |
+
|
| 18 |
+
The .dist-info/WHEEL file must contain one or more tags so that the target
|
| 19 |
+
wheel file name can be determined.
|
| 20 |
+
|
| 21 |
+
:param directory: The unpacked wheel directory
|
| 22 |
+
:param dest_dir: Destination directory (defaults to the current directory)
|
| 23 |
+
"""
|
| 24 |
+
# Find the .dist-info directory
|
| 25 |
+
dist_info_dirs = [
|
| 26 |
+
fn
|
| 27 |
+
for fn in os.listdir(directory)
|
| 28 |
+
if os.path.isdir(os.path.join(directory, fn)) and DIST_INFO_RE.match(fn)
|
| 29 |
+
]
|
| 30 |
+
if len(dist_info_dirs) > 1:
|
| 31 |
+
raise WheelError(f"Multiple .dist-info directories found in {directory}")
|
| 32 |
+
elif not dist_info_dirs:
|
| 33 |
+
raise WheelError(f"No .dist-info directories found in {directory}")
|
| 34 |
+
|
| 35 |
+
# Determine the target wheel filename
|
| 36 |
+
dist_info_dir = dist_info_dirs[0]
|
| 37 |
+
name_version = DIST_INFO_RE.match(dist_info_dir).group("namever")
|
| 38 |
+
|
| 39 |
+
# Read the tags and the existing build number from .dist-info/WHEEL
|
| 40 |
+
wheel_file_path = os.path.join(directory, dist_info_dir, "WHEEL")
|
| 41 |
+
with open(wheel_file_path, "rb") as f:
|
| 42 |
+
info = BytesParser(policy=email.policy.compat32).parse(f)
|
| 43 |
+
tags: list[str] = info.get_all("Tag", [])
|
| 44 |
+
existing_build_number = info.get("Build")
|
| 45 |
+
|
| 46 |
+
if not tags:
|
| 47 |
+
raise WheelError(
|
| 48 |
+
f"No tags present in {dist_info_dir}/WHEEL; cannot determine target "
|
| 49 |
+
f"wheel filename"
|
| 50 |
+
)
|
| 51 |
+
|
| 52 |
+
# Set the wheel file name and add/replace/remove the Build tag in .dist-info/WHEEL
|
| 53 |
+
build_number = build_number if build_number is not None else existing_build_number
|
| 54 |
+
if build_number is not None:
|
| 55 |
+
del info["Build"]
|
| 56 |
+
if build_number:
|
| 57 |
+
info["Build"] = build_number
|
| 58 |
+
name_version += "-" + build_number
|
| 59 |
+
|
| 60 |
+
if build_number != existing_build_number:
|
| 61 |
+
with open(wheel_file_path, "wb") as f:
|
| 62 |
+
BytesGenerator(f, maxheaderlen=0).flatten(info)
|
| 63 |
+
|
| 64 |
+
# Reassemble the tags for the wheel file
|
| 65 |
+
tagline = compute_tagline(tags)
|
| 66 |
+
|
| 67 |
+
# Repack the wheel
|
| 68 |
+
wheel_path = os.path.join(dest_dir, f"{name_version}-{tagline}.whl")
|
| 69 |
+
with WheelFile(wheel_path, "w") as wf:
|
| 70 |
+
print(f"Repacking wheel as {wheel_path}...", end="", flush=True)
|
| 71 |
+
wf.write_files(directory)
|
| 72 |
+
|
| 73 |
+
print("OK")
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
def compute_tagline(tags: list[str]) -> str:
|
| 77 |
+
"""Compute a tagline from a list of tags.
|
| 78 |
+
|
| 79 |
+
:param tags: A list of tags
|
| 80 |
+
:return: A tagline
|
| 81 |
+
"""
|
| 82 |
+
impls = sorted({tag.split("-")[0] for tag in tags})
|
| 83 |
+
abivers = sorted({tag.split("-")[1] for tag in tags})
|
| 84 |
+
platforms = sorted({tag.split("-")[2] for tag in tags})
|
| 85 |
+
return "-".join([".".join(impls), ".".join(abivers), ".".join(platforms)])
|
mantis_evalkit/lib/python3.10/site-packages/wheel/cli/tags.py
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import email.policy
|
| 4 |
+
import itertools
|
| 5 |
+
import os
|
| 6 |
+
from collections.abc import Iterable
|
| 7 |
+
from email.parser import BytesParser
|
| 8 |
+
|
| 9 |
+
from ..wheelfile import WheelFile
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def _compute_tags(original_tags: Iterable[str], new_tags: str | None) -> set[str]:
|
| 13 |
+
"""Add or replace tags. Supports dot-separated tags"""
|
| 14 |
+
if new_tags is None:
|
| 15 |
+
return set(original_tags)
|
| 16 |
+
|
| 17 |
+
if new_tags.startswith("+"):
|
| 18 |
+
return {*original_tags, *new_tags[1:].split(".")}
|
| 19 |
+
|
| 20 |
+
if new_tags.startswith("-"):
|
| 21 |
+
return set(original_tags) - set(new_tags[1:].split("."))
|
| 22 |
+
|
| 23 |
+
return set(new_tags.split("."))
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def tags(
|
| 27 |
+
wheel: str,
|
| 28 |
+
python_tags: str | None = None,
|
| 29 |
+
abi_tags: str | None = None,
|
| 30 |
+
platform_tags: str | None = None,
|
| 31 |
+
build_tag: str | None = None,
|
| 32 |
+
remove: bool = False,
|
| 33 |
+
) -> str:
|
| 34 |
+
"""Change the tags on a wheel file.
|
| 35 |
+
|
| 36 |
+
The tags are left unchanged if they are not specified. To specify "none",
|
| 37 |
+
use ["none"]. To append to the previous tags, a tag should start with a
|
| 38 |
+
"+". If a tag starts with "-", it will be removed from existing tags.
|
| 39 |
+
Processing is done left to right.
|
| 40 |
+
|
| 41 |
+
:param wheel: The paths to the wheels
|
| 42 |
+
:param python_tags: The Python tags to set
|
| 43 |
+
:param abi_tags: The ABI tags to set
|
| 44 |
+
:param platform_tags: The platform tags to set
|
| 45 |
+
:param build_tag: The build tag to set
|
| 46 |
+
:param remove: Remove the original wheel
|
| 47 |
+
"""
|
| 48 |
+
with WheelFile(wheel, "r") as f:
|
| 49 |
+
assert f.filename, f"{f.filename} must be available"
|
| 50 |
+
|
| 51 |
+
wheel_info = f.read(f.dist_info_path + "/WHEEL")
|
| 52 |
+
info = BytesParser(policy=email.policy.compat32).parsebytes(wheel_info)
|
| 53 |
+
|
| 54 |
+
original_wheel_name = os.path.basename(f.filename)
|
| 55 |
+
namever = f.parsed_filename.group("namever")
|
| 56 |
+
build = f.parsed_filename.group("build")
|
| 57 |
+
original_python_tags = f.parsed_filename.group("pyver").split(".")
|
| 58 |
+
original_abi_tags = f.parsed_filename.group("abi").split(".")
|
| 59 |
+
original_plat_tags = f.parsed_filename.group("plat").split(".")
|
| 60 |
+
|
| 61 |
+
tags: list[str] = info.get_all("Tag", [])
|
| 62 |
+
existing_build_tag = info.get("Build")
|
| 63 |
+
|
| 64 |
+
impls = {tag.split("-")[0] for tag in tags}
|
| 65 |
+
abivers = {tag.split("-")[1] for tag in tags}
|
| 66 |
+
platforms = {tag.split("-")[2] for tag in tags}
|
| 67 |
+
|
| 68 |
+
if impls != set(original_python_tags):
|
| 69 |
+
msg = f"Wheel internal tags {impls!r} != filename tags {original_python_tags!r}"
|
| 70 |
+
raise AssertionError(msg)
|
| 71 |
+
|
| 72 |
+
if abivers != set(original_abi_tags):
|
| 73 |
+
msg = f"Wheel internal tags {abivers!r} != filename tags {original_abi_tags!r}"
|
| 74 |
+
raise AssertionError(msg)
|
| 75 |
+
|
| 76 |
+
if platforms != set(original_plat_tags):
|
| 77 |
+
msg = (
|
| 78 |
+
f"Wheel internal tags {platforms!r} != filename tags {original_plat_tags!r}"
|
| 79 |
+
)
|
| 80 |
+
raise AssertionError(msg)
|
| 81 |
+
|
| 82 |
+
if existing_build_tag != build:
|
| 83 |
+
msg = (
|
| 84 |
+
f"Incorrect filename '{build}' "
|
| 85 |
+
f"& *.dist-info/WHEEL '{existing_build_tag}' build numbers"
|
| 86 |
+
)
|
| 87 |
+
raise AssertionError(msg)
|
| 88 |
+
|
| 89 |
+
# Start changing as needed
|
| 90 |
+
if build_tag is not None:
|
| 91 |
+
build = build_tag
|
| 92 |
+
|
| 93 |
+
final_python_tags = sorted(_compute_tags(original_python_tags, python_tags))
|
| 94 |
+
final_abi_tags = sorted(_compute_tags(original_abi_tags, abi_tags))
|
| 95 |
+
final_plat_tags = sorted(_compute_tags(original_plat_tags, platform_tags))
|
| 96 |
+
|
| 97 |
+
final_tags = [
|
| 98 |
+
namever,
|
| 99 |
+
".".join(final_python_tags),
|
| 100 |
+
".".join(final_abi_tags),
|
| 101 |
+
".".join(final_plat_tags),
|
| 102 |
+
]
|
| 103 |
+
if build:
|
| 104 |
+
final_tags.insert(1, build)
|
| 105 |
+
|
| 106 |
+
final_wheel_name = "-".join(final_tags) + ".whl"
|
| 107 |
+
|
| 108 |
+
if original_wheel_name != final_wheel_name:
|
| 109 |
+
del info["Tag"], info["Build"]
|
| 110 |
+
for a, b, c in itertools.product(
|
| 111 |
+
final_python_tags, final_abi_tags, final_plat_tags
|
| 112 |
+
):
|
| 113 |
+
info["Tag"] = f"{a}-{b}-{c}"
|
| 114 |
+
if build:
|
| 115 |
+
info["Build"] = build
|
| 116 |
+
|
| 117 |
+
original_wheel_path = os.path.join(
|
| 118 |
+
os.path.dirname(f.filename), original_wheel_name
|
| 119 |
+
)
|
| 120 |
+
final_wheel_path = os.path.join(os.path.dirname(f.filename), final_wheel_name)
|
| 121 |
+
|
| 122 |
+
with WheelFile(original_wheel_path, "r") as fin, WheelFile(
|
| 123 |
+
final_wheel_path, "w"
|
| 124 |
+
) as fout:
|
| 125 |
+
fout.comment = fin.comment # preserve the comment
|
| 126 |
+
for item in fin.infolist():
|
| 127 |
+
if item.is_dir():
|
| 128 |
+
continue
|
| 129 |
+
if item.filename == f.dist_info_path + "/RECORD":
|
| 130 |
+
continue
|
| 131 |
+
if item.filename == f.dist_info_path + "/WHEEL":
|
| 132 |
+
fout.writestr(item, info.as_bytes())
|
| 133 |
+
else:
|
| 134 |
+
fout.writestr(item, fin.read(item))
|
| 135 |
+
|
| 136 |
+
if remove:
|
| 137 |
+
os.remove(original_wheel_path)
|
| 138 |
+
|
| 139 |
+
return final_wheel_name
|
mantis_evalkit/lib/python3.10/site-packages/wheel/cli/unpack.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from pathlib import Path
|
| 4 |
+
|
| 5 |
+
from ..wheelfile import WheelFile
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
def unpack(path: str, dest: str = ".") -> None:
|
| 9 |
+
"""Unpack a wheel.
|
| 10 |
+
|
| 11 |
+
Wheel content will be unpacked to {dest}/{name}-{ver}, where {name}
|
| 12 |
+
is the package name and {ver} its version.
|
| 13 |
+
|
| 14 |
+
:param path: The path to the wheel.
|
| 15 |
+
:param dest: Destination directory (default to current directory).
|
| 16 |
+
"""
|
| 17 |
+
with WheelFile(path) as wf:
|
| 18 |
+
namever = wf.parsed_filename.group("namever")
|
| 19 |
+
destination = Path(dest) / namever
|
| 20 |
+
print(f"Unpacking to: {destination}...", end="", flush=True)
|
| 21 |
+
for zinfo in wf.filelist:
|
| 22 |
+
wf.extract(zinfo, destination)
|
| 23 |
+
|
| 24 |
+
# Set permissions to the same values as they were set in the archive
|
| 25 |
+
# We have to do this manually due to
|
| 26 |
+
# https://github.com/python/cpython/issues/59999
|
| 27 |
+
permissions = zinfo.external_attr >> 16 & 0o777
|
| 28 |
+
destination.joinpath(zinfo.filename).chmod(permissions)
|
| 29 |
+
|
| 30 |
+
print("OK")
|
mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (148 Bytes). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (158 Bytes). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/_elffile.cpython-310.pyc
ADDED
|
Binary file (3.28 kB). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/_manylinux.cpython-310.pyc
ADDED
|
Binary file (6.39 kB). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/_musllinux.cpython-310.pyc
ADDED
|
Binary file (3.31 kB). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/_parser.cpython-310.pyc
ADDED
|
Binary file (8.93 kB). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/_tokenizer.cpython-310.pyc
ADDED
|
Binary file (5.79 kB). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/markers.cpython-310.pyc
ADDED
|
Binary file (6.88 kB). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/specifiers.cpython-310.pyc
ADDED
|
Binary file (31 kB). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/tags.cpython-310.pyc
ADDED
|
Binary file (13.8 kB). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/utils.cpython-310.pyc
ADDED
|
Binary file (4.49 kB). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/__pycache__/version.cpython-310.pyc
ADDED
|
Binary file (14.1 kB). View file
|
|
|
mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/_manylinux.py
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import collections
|
| 2 |
+
import contextlib
|
| 3 |
+
import functools
|
| 4 |
+
import os
|
| 5 |
+
import re
|
| 6 |
+
import sys
|
| 7 |
+
import warnings
|
| 8 |
+
from typing import Dict, Generator, Iterator, NamedTuple, Optional, Sequence, Tuple
|
| 9 |
+
|
| 10 |
+
from ._elffile import EIClass, EIData, ELFFile, EMachine
|
| 11 |
+
|
| 12 |
+
EF_ARM_ABIMASK = 0xFF000000
|
| 13 |
+
EF_ARM_ABI_VER5 = 0x05000000
|
| 14 |
+
EF_ARM_ABI_FLOAT_HARD = 0x00000400
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
# `os.PathLike` not a generic type until Python 3.9, so sticking with `str`
|
| 18 |
+
# as the type for `path` until then.
|
| 19 |
+
@contextlib.contextmanager
|
| 20 |
+
def _parse_elf(path: str) -> Generator[Optional[ELFFile], None, None]:
|
| 21 |
+
try:
|
| 22 |
+
with open(path, "rb") as f:
|
| 23 |
+
yield ELFFile(f)
|
| 24 |
+
except (OSError, TypeError, ValueError):
|
| 25 |
+
yield None
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def _is_linux_armhf(executable: str) -> bool:
|
| 29 |
+
# hard-float ABI can be detected from the ELF header of the running
|
| 30 |
+
# process
|
| 31 |
+
# https://static.docs.arm.com/ihi0044/g/aaelf32.pdf
|
| 32 |
+
with _parse_elf(executable) as f:
|
| 33 |
+
return (
|
| 34 |
+
f is not None
|
| 35 |
+
and f.capacity == EIClass.C32
|
| 36 |
+
and f.encoding == EIData.Lsb
|
| 37 |
+
and f.machine == EMachine.Arm
|
| 38 |
+
and f.flags & EF_ARM_ABIMASK == EF_ARM_ABI_VER5
|
| 39 |
+
and f.flags & EF_ARM_ABI_FLOAT_HARD == EF_ARM_ABI_FLOAT_HARD
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
def _is_linux_i686(executable: str) -> bool:
|
| 44 |
+
with _parse_elf(executable) as f:
|
| 45 |
+
return (
|
| 46 |
+
f is not None
|
| 47 |
+
and f.capacity == EIClass.C32
|
| 48 |
+
and f.encoding == EIData.Lsb
|
| 49 |
+
and f.machine == EMachine.I386
|
| 50 |
+
)
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
def _have_compatible_abi(executable: str, archs: Sequence[str]) -> bool:
|
| 54 |
+
if "armv7l" in archs:
|
| 55 |
+
return _is_linux_armhf(executable)
|
| 56 |
+
if "i686" in archs:
|
| 57 |
+
return _is_linux_i686(executable)
|
| 58 |
+
allowed_archs = {
|
| 59 |
+
"x86_64",
|
| 60 |
+
"aarch64",
|
| 61 |
+
"ppc64",
|
| 62 |
+
"ppc64le",
|
| 63 |
+
"s390x",
|
| 64 |
+
"loongarch64",
|
| 65 |
+
"riscv64",
|
| 66 |
+
}
|
| 67 |
+
return any(arch in allowed_archs for arch in archs)
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
# If glibc ever changes its major version, we need to know what the last
|
| 71 |
+
# minor version was, so we can build the complete list of all versions.
|
| 72 |
+
# For now, guess what the highest minor version might be, assume it will
|
| 73 |
+
# be 50 for testing. Once this actually happens, update the dictionary
|
| 74 |
+
# with the actual value.
|
| 75 |
+
_LAST_GLIBC_MINOR: Dict[int, int] = collections.defaultdict(lambda: 50)
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
class _GLibCVersion(NamedTuple):
|
| 79 |
+
major: int
|
| 80 |
+
minor: int
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
def _glibc_version_string_confstr() -> Optional[str]:
|
| 84 |
+
"""
|
| 85 |
+
Primary implementation of glibc_version_string using os.confstr.
|
| 86 |
+
"""
|
| 87 |
+
# os.confstr is quite a bit faster than ctypes.DLL. It's also less likely
|
| 88 |
+
# to be broken or missing. This strategy is used in the standard library
|
| 89 |
+
# platform module.
|
| 90 |
+
# https://github.com/python/cpython/blob/fcf1d003bf4f0100c/Lib/platform.py#L175-L183
|
| 91 |
+
try:
|
| 92 |
+
# Should be a string like "glibc 2.17".
|
| 93 |
+
version_string: Optional[str] = os.confstr("CS_GNU_LIBC_VERSION")
|
| 94 |
+
assert version_string is not None
|
| 95 |
+
_, version = version_string.rsplit()
|
| 96 |
+
except (AssertionError, AttributeError, OSError, ValueError):
|
| 97 |
+
# os.confstr() or CS_GNU_LIBC_VERSION not available (or a bad value)...
|
| 98 |
+
return None
|
| 99 |
+
return version
|
| 100 |
+
|
| 101 |
+
|
| 102 |
+
def _glibc_version_string_ctypes() -> Optional[str]:
|
| 103 |
+
"""
|
| 104 |
+
Fallback implementation of glibc_version_string using ctypes.
|
| 105 |
+
"""
|
| 106 |
+
try:
|
| 107 |
+
import ctypes
|
| 108 |
+
except ImportError:
|
| 109 |
+
return None
|
| 110 |
+
|
| 111 |
+
# ctypes.CDLL(None) internally calls dlopen(NULL), and as the dlopen
|
| 112 |
+
# manpage says, "If filename is NULL, then the returned handle is for the
|
| 113 |
+
# main program". This way we can let the linker do the work to figure out
|
| 114 |
+
# which libc our process is actually using.
|
| 115 |
+
#
|
| 116 |
+
# We must also handle the special case where the executable is not a
|
| 117 |
+
# dynamically linked executable. This can occur when using musl libc,
|
| 118 |
+
# for example. In this situation, dlopen() will error, leading to an
|
| 119 |
+
# OSError. Interestingly, at least in the case of musl, there is no
|
| 120 |
+
# errno set on the OSError. The single string argument used to construct
|
| 121 |
+
# OSError comes from libc itself and is therefore not portable to
|
| 122 |
+
# hard code here. In any case, failure to call dlopen() means we
|
| 123 |
+
# can proceed, so we bail on our attempt.
|
| 124 |
+
try:
|
| 125 |
+
process_namespace = ctypes.CDLL(None)
|
| 126 |
+
except OSError:
|
| 127 |
+
return None
|
| 128 |
+
|
| 129 |
+
try:
|
| 130 |
+
gnu_get_libc_version = process_namespace.gnu_get_libc_version
|
| 131 |
+
except AttributeError:
|
| 132 |
+
# Symbol doesn't exist -> therefore, we are not linked to
|
| 133 |
+
# glibc.
|
| 134 |
+
return None
|
| 135 |
+
|
| 136 |
+
# Call gnu_get_libc_version, which returns a string like "2.5"
|
| 137 |
+
gnu_get_libc_version.restype = ctypes.c_char_p
|
| 138 |
+
version_str: str = gnu_get_libc_version()
|
| 139 |
+
# py2 / py3 compatibility:
|
| 140 |
+
if not isinstance(version_str, str):
|
| 141 |
+
version_str = version_str.decode("ascii")
|
| 142 |
+
|
| 143 |
+
return version_str
|
| 144 |
+
|
| 145 |
+
|
| 146 |
+
def _glibc_version_string() -> Optional[str]:
|
| 147 |
+
"""Returns glibc version string, or None if not using glibc."""
|
| 148 |
+
return _glibc_version_string_confstr() or _glibc_version_string_ctypes()
|
| 149 |
+
|
| 150 |
+
|
| 151 |
+
def _parse_glibc_version(version_str: str) -> Tuple[int, int]:
|
| 152 |
+
"""Parse glibc version.
|
| 153 |
+
|
| 154 |
+
We use a regexp instead of str.split because we want to discard any
|
| 155 |
+
random junk that might come after the minor version -- this might happen
|
| 156 |
+
in patched/forked versions of glibc (e.g. Linaro's version of glibc
|
| 157 |
+
uses version strings like "2.20-2014.11"). See gh-3588.
|
| 158 |
+
"""
|
| 159 |
+
m = re.match(r"(?P<major>[0-9]+)\.(?P<minor>[0-9]+)", version_str)
|
| 160 |
+
if not m:
|
| 161 |
+
warnings.warn(
|
| 162 |
+
f"Expected glibc version with 2 components major.minor,"
|
| 163 |
+
f" got: {version_str}",
|
| 164 |
+
RuntimeWarning,
|
| 165 |
+
)
|
| 166 |
+
return -1, -1
|
| 167 |
+
return int(m.group("major")), int(m.group("minor"))
|
| 168 |
+
|
| 169 |
+
|
| 170 |
+
@functools.lru_cache
|
| 171 |
+
def _get_glibc_version() -> Tuple[int, int]:
|
| 172 |
+
version_str = _glibc_version_string()
|
| 173 |
+
if version_str is None:
|
| 174 |
+
return (-1, -1)
|
| 175 |
+
return _parse_glibc_version(version_str)
|
| 176 |
+
|
| 177 |
+
|
| 178 |
+
# From PEP 513, PEP 600
|
| 179 |
+
def _is_compatible(arch: str, version: _GLibCVersion) -> bool:
|
| 180 |
+
sys_glibc = _get_glibc_version()
|
| 181 |
+
if sys_glibc < version:
|
| 182 |
+
return False
|
| 183 |
+
# Check for presence of _manylinux module.
|
| 184 |
+
try:
|
| 185 |
+
import _manylinux
|
| 186 |
+
except ImportError:
|
| 187 |
+
return True
|
| 188 |
+
if hasattr(_manylinux, "manylinux_compatible"):
|
| 189 |
+
result = _manylinux.manylinux_compatible(version[0], version[1], arch)
|
| 190 |
+
if result is not None:
|
| 191 |
+
return bool(result)
|
| 192 |
+
return True
|
| 193 |
+
if version == _GLibCVersion(2, 5):
|
| 194 |
+
if hasattr(_manylinux, "manylinux1_compatible"):
|
| 195 |
+
return bool(_manylinux.manylinux1_compatible)
|
| 196 |
+
if version == _GLibCVersion(2, 12):
|
| 197 |
+
if hasattr(_manylinux, "manylinux2010_compatible"):
|
| 198 |
+
return bool(_manylinux.manylinux2010_compatible)
|
| 199 |
+
if version == _GLibCVersion(2, 17):
|
| 200 |
+
if hasattr(_manylinux, "manylinux2014_compatible"):
|
| 201 |
+
return bool(_manylinux.manylinux2014_compatible)
|
| 202 |
+
return True
|
| 203 |
+
|
| 204 |
+
|
| 205 |
+
_LEGACY_MANYLINUX_MAP = {
|
| 206 |
+
# CentOS 7 w/ glibc 2.17 (PEP 599)
|
| 207 |
+
(2, 17): "manylinux2014",
|
| 208 |
+
# CentOS 6 w/ glibc 2.12 (PEP 571)
|
| 209 |
+
(2, 12): "manylinux2010",
|
| 210 |
+
# CentOS 5 w/ glibc 2.5 (PEP 513)
|
| 211 |
+
(2, 5): "manylinux1",
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
|
| 215 |
+
def platform_tags(archs: Sequence[str]) -> Iterator[str]:
|
| 216 |
+
"""Generate manylinux tags compatible to the current platform.
|
| 217 |
+
|
| 218 |
+
:param archs: Sequence of compatible architectures.
|
| 219 |
+
The first one shall be the closest to the actual architecture and be the part of
|
| 220 |
+
platform tag after the ``linux_`` prefix, e.g. ``x86_64``.
|
| 221 |
+
The ``linux_`` prefix is assumed as a prerequisite for the current platform to
|
| 222 |
+
be manylinux-compatible.
|
| 223 |
+
|
| 224 |
+
:returns: An iterator of compatible manylinux tags.
|
| 225 |
+
"""
|
| 226 |
+
if not _have_compatible_abi(sys.executable, archs):
|
| 227 |
+
return
|
| 228 |
+
# Oldest glibc to be supported regardless of architecture is (2, 17).
|
| 229 |
+
too_old_glibc2 = _GLibCVersion(2, 16)
|
| 230 |
+
if set(archs) & {"x86_64", "i686"}:
|
| 231 |
+
# On x86/i686 also oldest glibc to be supported is (2, 5).
|
| 232 |
+
too_old_glibc2 = _GLibCVersion(2, 4)
|
| 233 |
+
current_glibc = _GLibCVersion(*_get_glibc_version())
|
| 234 |
+
glibc_max_list = [current_glibc]
|
| 235 |
+
# We can assume compatibility across glibc major versions.
|
| 236 |
+
# https://sourceware.org/bugzilla/show_bug.cgi?id=24636
|
| 237 |
+
#
|
| 238 |
+
# Build a list of maximum glibc versions so that we can
|
| 239 |
+
# output the canonical list of all glibc from current_glibc
|
| 240 |
+
# down to too_old_glibc2, including all intermediary versions.
|
| 241 |
+
for glibc_major in range(current_glibc.major - 1, 1, -1):
|
| 242 |
+
glibc_minor = _LAST_GLIBC_MINOR[glibc_major]
|
| 243 |
+
glibc_max_list.append(_GLibCVersion(glibc_major, glibc_minor))
|
| 244 |
+
for arch in archs:
|
| 245 |
+
for glibc_max in glibc_max_list:
|
| 246 |
+
if glibc_max.major == too_old_glibc2.major:
|
| 247 |
+
min_minor = too_old_glibc2.minor
|
| 248 |
+
else:
|
| 249 |
+
# For other glibc major versions oldest supported is (x, 0).
|
| 250 |
+
min_minor = -1
|
| 251 |
+
for glibc_minor in range(glibc_max.minor, min_minor, -1):
|
| 252 |
+
glibc_version = _GLibCVersion(glibc_max.major, glibc_minor)
|
| 253 |
+
tag = "manylinux_{}_{}".format(*glibc_version)
|
| 254 |
+
if _is_compatible(arch, glibc_version):
|
| 255 |
+
yield f"{tag}_{arch}"
|
| 256 |
+
# Handle the legacy manylinux1, manylinux2010, manylinux2014 tags.
|
| 257 |
+
if glibc_version in _LEGACY_MANYLINUX_MAP:
|
| 258 |
+
legacy_tag = _LEGACY_MANYLINUX_MAP[glibc_version]
|
| 259 |
+
if _is_compatible(arch, glibc_version):
|
| 260 |
+
yield f"{legacy_tag}_{arch}"
|
mantis_evalkit/lib/python3.10/site-packages/wheel/vendored/packaging/_structures.py
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This file is dual licensed under the terms of the Apache License, Version
|
| 2 |
+
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
| 3 |
+
# for complete details.
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
class InfinityType:
|
| 7 |
+
def __repr__(self) -> str:
|
| 8 |
+
return "Infinity"
|
| 9 |
+
|
| 10 |
+
def __hash__(self) -> int:
|
| 11 |
+
return hash(repr(self))
|
| 12 |
+
|
| 13 |
+
def __lt__(self, other: object) -> bool:
|
| 14 |
+
return False
|
| 15 |
+
|
| 16 |
+
def __le__(self, other: object) -> bool:
|
| 17 |
+
return False
|
| 18 |
+
|
| 19 |
+
def __eq__(self, other: object) -> bool:
|
| 20 |
+
return isinstance(other, self.__class__)
|
| 21 |
+
|
| 22 |
+
def __gt__(self, other: object) -> bool:
|
| 23 |
+
return True
|
| 24 |
+
|
| 25 |
+
def __ge__(self, other: object) -> bool:
|
| 26 |
+
return True
|
| 27 |
+
|
| 28 |
+
def __neg__(self: object) -> "NegativeInfinityType":
|
| 29 |
+
return NegativeInfinity
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
Infinity = InfinityType()
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
class NegativeInfinityType:
|
| 36 |
+
def __repr__(self) -> str:
|
| 37 |
+
return "-Infinity"
|
| 38 |
+
|
| 39 |
+
def __hash__(self) -> int:
|
| 40 |
+
return hash(repr(self))
|
| 41 |
+
|
| 42 |
+
def __lt__(self, other: object) -> bool:
|
| 43 |
+
return True
|
| 44 |
+
|
| 45 |
+
def __le__(self, other: object) -> bool:
|
| 46 |
+
return True
|
| 47 |
+
|
| 48 |
+
def __eq__(self, other: object) -> bool:
|
| 49 |
+
return isinstance(other, self.__class__)
|
| 50 |
+
|
| 51 |
+
def __gt__(self, other: object) -> bool:
|
| 52 |
+
return False
|
| 53 |
+
|
| 54 |
+
def __ge__(self, other: object) -> bool:
|
| 55 |
+
return False
|
| 56 |
+
|
| 57 |
+
def __neg__(self: object) -> InfinityType:
|
| 58 |
+
return Infinity
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
NegativeInfinity = NegativeInfinityType()
|
moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_aminmax.h
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// @generated by torchgen/gen.py from Function.h
|
| 4 |
+
|
| 5 |
+
#include <ATen/Context.h>
|
| 6 |
+
#include <ATen/DeviceGuard.h>
|
| 7 |
+
#include <ATen/TensorUtils.h>
|
| 8 |
+
#include <ATen/TracerMode.h>
|
| 9 |
+
#include <ATen/core/Generator.h>
|
| 10 |
+
#include <ATen/core/Reduction.h>
|
| 11 |
+
#include <ATen/core/Tensor.h>
|
| 12 |
+
#include <c10/core/Scalar.h>
|
| 13 |
+
#include <c10/core/Storage.h>
|
| 14 |
+
#include <c10/core/TensorOptions.h>
|
| 15 |
+
#include <c10/util/Deprecated.h>
|
| 16 |
+
#include <c10/util/Optional.h>
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
#include <ATen/ops/_aminmax_ops.h>
|
| 21 |
+
|
| 22 |
+
namespace at {
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
// aten::_aminmax(Tensor self) -> (Tensor, Tensor)
|
| 26 |
+
inline ::std::tuple<at::Tensor,at::Tensor> _aminmax(const at::Tensor & self) {
|
| 27 |
+
return at::_ops::_aminmax::call(self);
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
// aten::_aminmax.dim(Tensor self, int dim, bool keepdim=False) -> (Tensor, Tensor)
|
| 31 |
+
inline ::std::tuple<at::Tensor,at::Tensor> _aminmax(const at::Tensor & self, int64_t dim, bool keepdim=false) {
|
| 32 |
+
return at::_ops::_aminmax_dim::call(self, dim, keepdim);
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
// aten::_aminmax.out(Tensor self, *, Tensor(a!) out0, Tensor(b!) out1) -> (Tensor(a!), Tensor(b!))
|
| 36 |
+
inline ::std::tuple<at::Tensor &,at::Tensor &> _aminmax_out(at::Tensor & out0, at::Tensor & out1, const at::Tensor & self) {
|
| 37 |
+
return at::_ops::_aminmax_out::call(self, out0, out1);
|
| 38 |
+
}
|
| 39 |
+
// aten::_aminmax.out(Tensor self, *, Tensor(a!) out0, Tensor(b!) out1) -> (Tensor(a!), Tensor(b!))
|
| 40 |
+
inline ::std::tuple<at::Tensor &,at::Tensor &> _aminmax_outf(const at::Tensor & self, at::Tensor & out0, at::Tensor & out1) {
|
| 41 |
+
return at::_ops::_aminmax_out::call(self, out0, out1);
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
// aten::_aminmax.dim_out(Tensor self, int dim, bool keepdim=False, *, Tensor(a!) out0, Tensor(b!) out1) -> (Tensor(a!), Tensor(b!))
|
| 45 |
+
inline ::std::tuple<at::Tensor &,at::Tensor &> _aminmax_out(at::Tensor & out0, at::Tensor & out1, const at::Tensor & self, int64_t dim, bool keepdim=false) {
|
| 46 |
+
return at::_ops::_aminmax_dim_out::call(self, dim, keepdim, out0, out1);
|
| 47 |
+
}
|
| 48 |
+
// aten::_aminmax.dim_out(Tensor self, int dim, bool keepdim=False, *, Tensor(a!) out0, Tensor(b!) out1) -> (Tensor(a!), Tensor(b!))
|
| 49 |
+
inline ::std::tuple<at::Tensor &,at::Tensor &> _aminmax_outf(const at::Tensor & self, int64_t dim, bool keepdim, at::Tensor & out0, at::Tensor & out1) {
|
| 50 |
+
return at::_ops::_aminmax_dim_out::call(self, dim, keepdim, out0, out1);
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
}
|
moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_assert_tensor_metadata.h
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// @generated by torchgen/gen.py from Function.h
|
| 4 |
+
|
| 5 |
+
#include <ATen/Context.h>
|
| 6 |
+
#include <ATen/DeviceGuard.h>
|
| 7 |
+
#include <ATen/TensorUtils.h>
|
| 8 |
+
#include <ATen/TracerMode.h>
|
| 9 |
+
#include <ATen/core/Generator.h>
|
| 10 |
+
#include <ATen/core/Reduction.h>
|
| 11 |
+
#include <ATen/core/Tensor.h>
|
| 12 |
+
#include <c10/core/Scalar.h>
|
| 13 |
+
#include <c10/core/Storage.h>
|
| 14 |
+
#include <c10/core/TensorOptions.h>
|
| 15 |
+
#include <c10/util/Deprecated.h>
|
| 16 |
+
#include <c10/util/Optional.h>
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
#include <ATen/ops/_assert_tensor_metadata_ops.h>
|
| 21 |
+
|
| 22 |
+
namespace at {
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
// aten::_assert_tensor_metadata(Tensor a, SymInt[]? size=None, SymInt[]? stride=None, ScalarType? dtype=None) -> ()
|
| 26 |
+
inline void _assert_tensor_metadata(const at::Tensor & a, at::OptionalIntArrayRef size=c10::nullopt, at::OptionalIntArrayRef stride=c10::nullopt, c10::optional<at::ScalarType> dtype=c10::nullopt) {
|
| 27 |
+
return at::_ops::_assert_tensor_metadata::call(a, size.has_value() ? c10::make_optional(c10::fromIntArrayRefSlow(*size)) : c10::nullopt, stride.has_value() ? c10::make_optional(c10::fromIntArrayRefSlow(*stride)) : c10::nullopt, dtype);
|
| 28 |
+
}
|
| 29 |
+
namespace symint {
|
| 30 |
+
template <typename T, typename = std::enable_if_t<std::is_same<T, int64_t>::value>>
|
| 31 |
+
void _assert_tensor_metadata(const at::Tensor & a, at::OptionalIntArrayRef size=c10::nullopt, at::OptionalIntArrayRef stride=c10::nullopt, c10::optional<at::ScalarType> dtype=c10::nullopt) {
|
| 32 |
+
return at::_ops::_assert_tensor_metadata::call(a, size.has_value() ? c10::make_optional(c10::fromIntArrayRefSlow(*size)) : c10::nullopt, stride.has_value() ? c10::make_optional(c10::fromIntArrayRefSlow(*stride)) : c10::nullopt, dtype);
|
| 33 |
+
}
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
// aten::_assert_tensor_metadata(Tensor a, SymInt[]? size=None, SymInt[]? stride=None, ScalarType? dtype=None) -> ()
|
| 37 |
+
inline void _assert_tensor_metadata_symint(const at::Tensor & a, at::OptionalSymIntArrayRef size=c10::nullopt, at::OptionalSymIntArrayRef stride=c10::nullopt, c10::optional<at::ScalarType> dtype=c10::nullopt) {
|
| 38 |
+
return at::_ops::_assert_tensor_metadata::call(a, size, stride, dtype);
|
| 39 |
+
}
|
| 40 |
+
namespace symint {
|
| 41 |
+
template <typename T, typename = std::enable_if_t<std::is_same<T, c10::SymInt>::value>>
|
| 42 |
+
void _assert_tensor_metadata(const at::Tensor & a, at::OptionalSymIntArrayRef size=c10::nullopt, at::OptionalSymIntArrayRef stride=c10::nullopt, c10::optional<at::ScalarType> dtype=c10::nullopt) {
|
| 43 |
+
return at::_ops::_assert_tensor_metadata::call(a, size, stride, dtype);
|
| 44 |
+
}
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
}
|
moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_autocast_to_reduced_precision.h
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// @generated by torchgen/gen.py from Function.h
|
| 4 |
+
|
| 5 |
+
#include <ATen/Context.h>
|
| 6 |
+
#include <ATen/DeviceGuard.h>
|
| 7 |
+
#include <ATen/TensorUtils.h>
|
| 8 |
+
#include <ATen/TracerMode.h>
|
| 9 |
+
#include <ATen/core/Generator.h>
|
| 10 |
+
#include <ATen/core/Reduction.h>
|
| 11 |
+
#include <ATen/core/Tensor.h>
|
| 12 |
+
#include <c10/core/Scalar.h>
|
| 13 |
+
#include <c10/core/Storage.h>
|
| 14 |
+
#include <c10/core/TensorOptions.h>
|
| 15 |
+
#include <c10/util/Deprecated.h>
|
| 16 |
+
#include <c10/util/Optional.h>
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
#include <ATen/ops/_autocast_to_reduced_precision_ops.h>
|
| 21 |
+
|
| 22 |
+
namespace at {
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
}
|
moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_convert_indices_from_coo_to_csr_ops.h
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// @generated by torchgen/gen.py from Operator.h
|
| 4 |
+
|
| 5 |
+
#include <tuple>
|
| 6 |
+
#include <vector>
|
| 7 |
+
|
| 8 |
+
// Forward declarations of any types needed in the operator signatures.
|
| 9 |
+
// We can't directly include these classes because it will cause circular include dependencies.
|
| 10 |
+
// This file is included by TensorBody.h, which defines the Tensor class.
|
| 11 |
+
#include <ATen/core/ATen_fwd.h>
|
| 12 |
+
|
| 13 |
+
namespace at {
|
| 14 |
+
namespace _ops {
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
struct TORCH_API _convert_indices_from_coo_to_csr {
|
| 18 |
+
using schema = at::Tensor (const at::Tensor &, int64_t, bool);
|
| 19 |
+
using ptr_schema = schema*;
|
| 20 |
+
// See Note [static constexpr char* members for windows NVCC]
|
| 21 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_convert_indices_from_coo_to_csr")
|
| 22 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "")
|
| 23 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_convert_indices_from_coo_to_csr(Tensor self, int size, *, bool out_int32=False) -> Tensor")
|
| 24 |
+
static at::Tensor call(const at::Tensor & self, int64_t size, bool out_int32);
|
| 25 |
+
static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, int64_t size, bool out_int32);
|
| 26 |
+
};
|
| 27 |
+
|
| 28 |
+
struct TORCH_API _convert_indices_from_coo_to_csr_out {
|
| 29 |
+
using schema = at::Tensor & (const at::Tensor &, int64_t, bool, at::Tensor &);
|
| 30 |
+
using ptr_schema = schema*;
|
| 31 |
+
// See Note [static constexpr char* members for windows NVCC]
|
| 32 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_convert_indices_from_coo_to_csr")
|
| 33 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out")
|
| 34 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_convert_indices_from_coo_to_csr.out(Tensor self, int size, *, bool out_int32=False, Tensor(a!) out) -> Tensor(a!)")
|
| 35 |
+
static at::Tensor & call(const at::Tensor & self, int64_t size, bool out_int32, at::Tensor & out);
|
| 36 |
+
static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, int64_t size, bool out_int32, at::Tensor & out);
|
| 37 |
+
};
|
| 38 |
+
|
| 39 |
+
}} // namespace at::_ops
|
moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_foreach_log10_cuda_dispatch.h
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
// @generated by torchgen/gen.py from DispatchKeyFunction.h
|
| 3 |
+
|
| 4 |
+
// NB: The implementing C++ file is RegisterDispatchKey.cpp
|
| 5 |
+
|
| 6 |
+
// The only #includes we need are for custom classes that have defaults in the C++ API
|
| 7 |
+
#include <c10/core/MemoryFormat.h>
|
| 8 |
+
#include <c10/core/Scalar.h>
|
| 9 |
+
#include <ATen/core/Reduction.h>
|
| 10 |
+
|
| 11 |
+
// Forward declarations of any types needed in the operator signatures.
|
| 12 |
+
// We can't directly include these classes because it will cause circular include dependencies.
|
| 13 |
+
// This file is included by TensorBody.h, which defines the Tensor class.
|
| 14 |
+
#include <ATen/core/ATen_fwd.h>
|
| 15 |
+
|
| 16 |
+
namespace at {
|
| 17 |
+
|
| 18 |
+
namespace cuda {
|
| 19 |
+
|
| 20 |
+
TORCH_API ::std::vector<at::Tensor> _foreach_log10(at::TensorList self);
|
| 21 |
+
TORCH_API void _foreach_log10_(at::TensorList self);
|
| 22 |
+
|
| 23 |
+
} // namespace cuda
|
| 24 |
+
} // namespace at
|
moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_fused_adam_compositeexplicitautograd_dispatch.h
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
// @generated by torchgen/gen.py from DispatchKeyFunction.h
|
| 3 |
+
|
| 4 |
+
// NB: The implementing C++ file is RegisterDispatchKey.cpp
|
| 5 |
+
|
| 6 |
+
// The only #includes we need are for custom classes that have defaults in the C++ API
|
| 7 |
+
#include <c10/core/MemoryFormat.h>
|
| 8 |
+
#include <c10/core/Scalar.h>
|
| 9 |
+
#include <ATen/core/Reduction.h>
|
| 10 |
+
|
| 11 |
+
// Forward declarations of any types needed in the operator signatures.
|
| 12 |
+
// We can't directly include these classes because it will cause circular include dependencies.
|
| 13 |
+
// This file is included by TensorBody.h, which defines the Tensor class.
|
| 14 |
+
#include <ATen/core/ATen_fwd.h>
|
| 15 |
+
|
| 16 |
+
namespace at {
|
| 17 |
+
|
| 18 |
+
namespace compositeexplicitautograd {
|
| 19 |
+
|
| 20 |
+
TORCH_API ::std::tuple<::std::vector<at::Tensor>,::std::vector<at::Tensor>,::std::vector<at::Tensor>,::std::vector<at::Tensor>,::std::vector<at::Tensor>> _fused_adam(at::TensorList self, at::TensorList grads, at::TensorList exp_avgs, at::TensorList exp_avg_sqs, at::TensorList max_exp_avg_sqs, at::TensorList state_steps, double lr, double beta1, double beta2, double weight_decay, double eps, bool amsgrad, bool maximize, const c10::optional<at::Tensor> & grad_scale={}, const c10::optional<at::Tensor> & found_inf={});
|
| 21 |
+
TORCH_API void _fused_adam_out(at::TensorList out, at::TensorList self, at::TensorList grads, at::TensorList exp_avgs, at::TensorList exp_avg_sqs, at::TensorList max_exp_avg_sqs, at::TensorList state_steps, double lr, double beta1, double beta2, double weight_decay, double eps, bool amsgrad, bool maximize, const c10::optional<at::Tensor> & grad_scale={}, const c10::optional<at::Tensor> & found_inf={});
|
| 22 |
+
TORCH_API void _fused_adam_outf(at::TensorList self, at::TensorList grads, at::TensorList exp_avgs, at::TensorList exp_avg_sqs, at::TensorList max_exp_avg_sqs, at::TensorList state_steps, double lr, double beta1, double beta2, double weight_decay, double eps, bool amsgrad, bool maximize, const c10::optional<at::Tensor> & grad_scale, const c10::optional<at::Tensor> & found_inf, at::TensorList out);
|
| 23 |
+
TORCH_API ::std::tuple<::std::vector<at::Tensor>,::std::vector<at::Tensor>,::std::vector<at::Tensor>,::std::vector<at::Tensor>,::std::vector<at::Tensor>> _fused_adam(at::TensorList self, at::TensorList grads, at::TensorList exp_avgs, at::TensorList exp_avg_sqs, at::TensorList max_exp_avg_sqs, at::TensorList state_steps, const at::Tensor & lr, double beta1, double beta2, double weight_decay, double eps, bool amsgrad, bool maximize, const c10::optional<at::Tensor> & grad_scale={}, const c10::optional<at::Tensor> & found_inf={});
|
| 24 |
+
TORCH_API void _fused_adam_out(at::TensorList out, at::TensorList self, at::TensorList grads, at::TensorList exp_avgs, at::TensorList exp_avg_sqs, at::TensorList max_exp_avg_sqs, at::TensorList state_steps, const at::Tensor & lr, double beta1, double beta2, double weight_decay, double eps, bool amsgrad, bool maximize, const c10::optional<at::Tensor> & grad_scale={}, const c10::optional<at::Tensor> & found_inf={});
|
| 25 |
+
TORCH_API void _fused_adam_outf(at::TensorList self, at::TensorList grads, at::TensorList exp_avgs, at::TensorList exp_avg_sqs, at::TensorList max_exp_avg_sqs, at::TensorList state_steps, const at::Tensor & lr, double beta1, double beta2, double weight_decay, double eps, bool amsgrad, bool maximize, const c10::optional<at::Tensor> & grad_scale, const c10::optional<at::Tensor> & found_inf, at::TensorList out);
|
| 26 |
+
|
| 27 |
+
} // namespace compositeexplicitautograd
|
| 28 |
+
} // namespace at
|
moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_make_dual_ops.h
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// @generated by torchgen/gen.py from Operator.h
|
| 4 |
+
|
| 5 |
+
#include <tuple>
|
| 6 |
+
#include <vector>
|
| 7 |
+
|
| 8 |
+
// Forward declarations of any types needed in the operator signatures.
|
| 9 |
+
// We can't directly include these classes because it will cause circular include dependencies.
|
| 10 |
+
// This file is included by TensorBody.h, which defines the Tensor class.
|
| 11 |
+
#include <ATen/core/ATen_fwd.h>
|
| 12 |
+
|
| 13 |
+
namespace at {
|
| 14 |
+
namespace _ops {
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
struct TORCH_API _make_dual {
|
| 18 |
+
using schema = at::Tensor (const at::Tensor &, const at::Tensor &, int64_t);
|
| 19 |
+
using ptr_schema = schema*;
|
| 20 |
+
// See Note [static constexpr char* members for windows NVCC]
|
| 21 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_make_dual")
|
| 22 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "")
|
| 23 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_make_dual(Tensor(a) primal, Tensor tangent, int level) -> Tensor(a)")
|
| 24 |
+
static at::Tensor call(const at::Tensor & primal, const at::Tensor & tangent, int64_t level);
|
| 25 |
+
static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & primal, const at::Tensor & tangent, int64_t level);
|
| 26 |
+
};
|
| 27 |
+
|
| 28 |
+
}} // namespace at::_ops
|
moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_masked_softmax.h
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// @generated by torchgen/gen.py from Function.h
|
| 4 |
+
|
| 5 |
+
#include <ATen/Context.h>
|
| 6 |
+
#include <ATen/DeviceGuard.h>
|
| 7 |
+
#include <ATen/TensorUtils.h>
|
| 8 |
+
#include <ATen/TracerMode.h>
|
| 9 |
+
#include <ATen/core/Generator.h>
|
| 10 |
+
#include <ATen/core/Reduction.h>
|
| 11 |
+
#include <ATen/core/Tensor.h>
|
| 12 |
+
#include <c10/core/Scalar.h>
|
| 13 |
+
#include <c10/core/Storage.h>
|
| 14 |
+
#include <c10/core/TensorOptions.h>
|
| 15 |
+
#include <c10/util/Deprecated.h>
|
| 16 |
+
#include <c10/util/Optional.h>
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
#include <ATen/ops/_masked_softmax_ops.h>
|
| 21 |
+
|
| 22 |
+
namespace at {
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
// aten::_masked_softmax(Tensor self, Tensor mask, int? dim=None, int? mask_type=None) -> Tensor
|
| 26 |
+
inline at::Tensor _masked_softmax(const at::Tensor & self, const at::Tensor & mask, c10::optional<int64_t> dim=c10::nullopt, c10::optional<int64_t> mask_type=c10::nullopt) {
|
| 27 |
+
return at::_ops::_masked_softmax::call(self, mask, dim, mask_type);
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
// aten::_masked_softmax.out(Tensor self, Tensor mask, int? dim=None, int? mask_type=None, *, Tensor(a!) out) -> Tensor(a!)
|
| 31 |
+
inline at::Tensor & _masked_softmax_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & mask, c10::optional<int64_t> dim=c10::nullopt, c10::optional<int64_t> mask_type=c10::nullopt) {
|
| 32 |
+
return at::_ops::_masked_softmax_out::call(self, mask, dim, mask_type, out);
|
| 33 |
+
}
|
| 34 |
+
// aten::_masked_softmax.out(Tensor self, Tensor mask, int? dim=None, int? mask_type=None, *, Tensor(a!) out) -> Tensor(a!)
|
| 35 |
+
inline at::Tensor & _masked_softmax_outf(const at::Tensor & self, const at::Tensor & mask, c10::optional<int64_t> dim, c10::optional<int64_t> mask_type, at::Tensor & out) {
|
| 36 |
+
return at::_ops::_masked_softmax_out::call(self, mask, dim, mask_type, out);
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
}
|
moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_masked_softmax_backward_native.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// @generated by torchgen/gen.py from NativeFunction.h
|
| 4 |
+
|
| 5 |
+
#include <c10/core/Scalar.h>
|
| 6 |
+
#include <c10/core/Storage.h>
|
| 7 |
+
#include <c10/core/TensorOptions.h>
|
| 8 |
+
#include <c10/util/Deprecated.h>
|
| 9 |
+
#include <c10/util/Optional.h>
|
| 10 |
+
#include <c10/core/QScheme.h>
|
| 11 |
+
#include <ATen/core/Reduction.h>
|
| 12 |
+
#include <ATen/core/Tensor.h>
|
| 13 |
+
#include <tuple>
|
| 14 |
+
#include <vector>
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
namespace at {
|
| 18 |
+
namespace native {
|
| 19 |
+
TORCH_API at::Tensor & _masked_softmax_backward_out(const at::Tensor & grad_output, const at::Tensor & output, const at::Tensor & mask, c10::optional<int64_t> dim, at::Tensor & out);
|
| 20 |
+
TORCH_API at::Tensor masked_softmax_backward_cpu(const at::Tensor & grad_output, const at::Tensor & output, const at::Tensor & mask, c10::optional<int64_t> dim=c10::nullopt);
|
| 21 |
+
TORCH_API at::Tensor masked_softmax_backward_cuda(const at::Tensor & grad_output, const at::Tensor & output, const at::Tensor & mask, c10::optional<int64_t> dim=c10::nullopt);
|
| 22 |
+
} // namespace native
|
| 23 |
+
} // namespace at
|
moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_nested_select_backward_ops.h
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// @generated by torchgen/gen.py from Operator.h
|
| 4 |
+
|
| 5 |
+
#include <tuple>
|
| 6 |
+
#include <vector>
|
| 7 |
+
|
| 8 |
+
// Forward declarations of any types needed in the operator signatures.
|
| 9 |
+
// We can't directly include these classes because it will cause circular include dependencies.
|
| 10 |
+
// This file is included by TensorBody.h, which defines the Tensor class.
|
| 11 |
+
#include <ATen/core/ATen_fwd.h>
|
| 12 |
+
|
| 13 |
+
namespace at {
|
| 14 |
+
namespace _ops {
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
struct TORCH_API _nested_select_backward {
|
| 18 |
+
using schema = at::Tensor (const at::Tensor &, const at::Tensor &, int64_t, c10::SymInt);
|
| 19 |
+
using ptr_schema = schema*;
|
| 20 |
+
// See Note [static constexpr char* members for windows NVCC]
|
| 21 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_nested_select_backward")
|
| 22 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "")
|
| 23 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_nested_select_backward(Tensor grad_output, Tensor self, int dim, SymInt index) -> Tensor")
|
| 24 |
+
static at::Tensor call(const at::Tensor & grad_output, const at::Tensor & self, int64_t dim, c10::SymInt index);
|
| 25 |
+
static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & grad_output, const at::Tensor & self, int64_t dim, c10::SymInt index);
|
| 26 |
+
};
|
| 27 |
+
|
| 28 |
+
}} // namespace at::_ops
|
moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_segment_reduce_backward.h
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// @generated by torchgen/gen.py from Function.h
|
| 4 |
+
|
| 5 |
+
#include <ATen/Context.h>
|
| 6 |
+
#include <ATen/DeviceGuard.h>
|
| 7 |
+
#include <ATen/TensorUtils.h>
|
| 8 |
+
#include <ATen/TracerMode.h>
|
| 9 |
+
#include <ATen/core/Generator.h>
|
| 10 |
+
#include <ATen/core/Reduction.h>
|
| 11 |
+
#include <ATen/core/Tensor.h>
|
| 12 |
+
#include <c10/core/Scalar.h>
|
| 13 |
+
#include <c10/core/Storage.h>
|
| 14 |
+
#include <c10/core/TensorOptions.h>
|
| 15 |
+
#include <c10/util/Deprecated.h>
|
| 16 |
+
#include <c10/util/Optional.h>
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
#include <ATen/ops/_segment_reduce_backward_ops.h>
|
| 21 |
+
|
| 22 |
+
namespace at {
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
// aten::_segment_reduce_backward(Tensor grad, Tensor output, Tensor data, str reduce, *, Tensor? lengths=None, Tensor? offsets=None, int axis=0, Scalar? initial=None) -> Tensor
|
| 26 |
+
inline at::Tensor _segment_reduce_backward(const at::Tensor & grad, const at::Tensor & output, const at::Tensor & data, c10::string_view reduce, const c10::optional<at::Tensor> & lengths={}, const c10::optional<at::Tensor> & offsets={}, int64_t axis=0, const c10::optional<at::Scalar> & initial=c10::nullopt) {
|
| 27 |
+
return at::_ops::_segment_reduce_backward::call(grad, output, data, reduce, lengths, offsets, axis, initial);
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
// aten::_segment_reduce_backward.out(Tensor grad, Tensor output, Tensor data, str reduce, *, Tensor? lengths=None, Tensor? offsets=None, int axis=0, Scalar? initial=None, Tensor(a!) out) -> Tensor(a!)
|
| 31 |
+
inline at::Tensor & _segment_reduce_backward_out(at::Tensor & out, const at::Tensor & grad, const at::Tensor & output, const at::Tensor & data, c10::string_view reduce, const c10::optional<at::Tensor> & lengths={}, const c10::optional<at::Tensor> & offsets={}, int64_t axis=0, const c10::optional<at::Scalar> & initial=c10::nullopt) {
|
| 32 |
+
return at::_ops::_segment_reduce_backward_out::call(grad, output, data, reduce, lengths, offsets, axis, initial, out);
|
| 33 |
+
}
|
| 34 |
+
// aten::_segment_reduce_backward.out(Tensor grad, Tensor output, Tensor data, str reduce, *, Tensor? lengths=None, Tensor? offsets=None, int axis=0, Scalar? initial=None, Tensor(a!) out) -> Tensor(a!)
|
| 35 |
+
inline at::Tensor & _segment_reduce_backward_outf(const at::Tensor & grad, const at::Tensor & output, const at::Tensor & data, c10::string_view reduce, const c10::optional<at::Tensor> & lengths, const c10::optional<at::Tensor> & offsets, int64_t axis, const c10::optional<at::Scalar> & initial, at::Tensor & out) {
|
| 36 |
+
return at::_ops::_segment_reduce_backward_out::call(grad, output, data, reduce, lengths, offsets, axis, initial, out);
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
}
|
moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_unsafe_index_put_ops.h
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// @generated by torchgen/gen.py from Operator.h
|
| 4 |
+
|
| 5 |
+
#include <tuple>
|
| 6 |
+
#include <vector>
|
| 7 |
+
|
| 8 |
+
// Forward declarations of any types needed in the operator signatures.
|
| 9 |
+
// We can't directly include these classes because it will cause circular include dependencies.
|
| 10 |
+
// This file is included by TensorBody.h, which defines the Tensor class.
|
| 11 |
+
#include <ATen/core/ATen_fwd.h>
|
| 12 |
+
|
| 13 |
+
namespace at {
|
| 14 |
+
namespace _ops {
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
struct TORCH_API _unsafe_index_put {
|
| 18 |
+
using schema = at::Tensor (const at::Tensor &, const c10::List<c10::optional<at::Tensor>> &, const at::Tensor &, bool);
|
| 19 |
+
using ptr_schema = schema*;
|
| 20 |
+
// See Note [static constexpr char* members for windows NVCC]
|
| 21 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_unsafe_index_put")
|
| 22 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "")
|
| 23 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_unsafe_index_put(Tensor self, Tensor?[] indices, Tensor values, bool accumulate=False) -> Tensor")
|
| 24 |
+
static at::Tensor call(const at::Tensor & self, const c10::List<c10::optional<at::Tensor>> & indices, const at::Tensor & values, bool accumulate);
|
| 25 |
+
static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const c10::List<c10::optional<at::Tensor>> & indices, const at::Tensor & values, bool accumulate);
|
| 26 |
+
};
|
| 27 |
+
|
| 28 |
+
}} // namespace at::_ops
|
moondream/lib/python3.10/site-packages/torch/include/ATen/ops/_upsample_bicubic2d_aa_ops.h
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// @generated by torchgen/gen.py from Operator.h
|
| 4 |
+
|
| 5 |
+
#include <tuple>
|
| 6 |
+
#include <vector>
|
| 7 |
+
|
| 8 |
+
// Forward declarations of any types needed in the operator signatures.
|
| 9 |
+
// We can't directly include these classes because it will cause circular include dependencies.
|
| 10 |
+
// This file is included by TensorBody.h, which defines the Tensor class.
|
| 11 |
+
#include <ATen/core/ATen_fwd.h>
|
| 12 |
+
|
| 13 |
+
namespace at {
|
| 14 |
+
namespace _ops {
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
struct TORCH_API _upsample_bicubic2d_aa_vec {
|
| 18 |
+
using schema = at::Tensor (const at::Tensor &, at::OptionalSymIntArrayRef, bool, c10::optional<at::ArrayRef<double>>);
|
| 19 |
+
using ptr_schema = schema*;
|
| 20 |
+
// See Note [static constexpr char* members for windows NVCC]
|
| 21 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_upsample_bicubic2d_aa")
|
| 22 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "vec")
|
| 23 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_upsample_bicubic2d_aa.vec(Tensor input, SymInt[]? output_size, bool align_corners, float[]? scale_factors) -> Tensor")
|
| 24 |
+
static at::Tensor call(const at::Tensor & input, at::OptionalSymIntArrayRef output_size, bool align_corners, c10::optional<at::ArrayRef<double>> scale_factors);
|
| 25 |
+
static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & input, at::OptionalSymIntArrayRef output_size, bool align_corners, c10::optional<at::ArrayRef<double>> scale_factors);
|
| 26 |
+
};
|
| 27 |
+
|
| 28 |
+
struct TORCH_API _upsample_bicubic2d_aa_out {
|
| 29 |
+
using schema = at::Tensor & (const at::Tensor &, c10::SymIntArrayRef, bool, c10::optional<double>, c10::optional<double>, at::Tensor &);
|
| 30 |
+
using ptr_schema = schema*;
|
| 31 |
+
// See Note [static constexpr char* members for windows NVCC]
|
| 32 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_upsample_bicubic2d_aa")
|
| 33 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out")
|
| 34 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_upsample_bicubic2d_aa.out(Tensor self, SymInt[2] output_size, bool align_corners, float? scales_h=None, float? scales_w=None, *, Tensor(a!) out) -> Tensor(a!)")
|
| 35 |
+
static at::Tensor & call(const at::Tensor & self, c10::SymIntArrayRef output_size, bool align_corners, c10::optional<double> scales_h, c10::optional<double> scales_w, at::Tensor & out);
|
| 36 |
+
static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, c10::SymIntArrayRef output_size, bool align_corners, c10::optional<double> scales_h, c10::optional<double> scales_w, at::Tensor & out);
|
| 37 |
+
};
|
| 38 |
+
|
| 39 |
+
struct TORCH_API _upsample_bicubic2d_aa {
|
| 40 |
+
using schema = at::Tensor (const at::Tensor &, c10::SymIntArrayRef, bool, c10::optional<double>, c10::optional<double>);
|
| 41 |
+
using ptr_schema = schema*;
|
| 42 |
+
// See Note [static constexpr char* members for windows NVCC]
|
| 43 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::_upsample_bicubic2d_aa")
|
| 44 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "")
|
| 45 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "_upsample_bicubic2d_aa(Tensor self, SymInt[2] output_size, bool align_corners, float? scales_h=None, float? scales_w=None) -> Tensor")
|
| 46 |
+
static at::Tensor call(const at::Tensor & self, c10::SymIntArrayRef output_size, bool align_corners, c10::optional<double> scales_h, c10::optional<double> scales_w);
|
| 47 |
+
static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, c10::SymIntArrayRef output_size, bool align_corners, c10::optional<double> scales_h, c10::optional<double> scales_w);
|
| 48 |
+
};
|
| 49 |
+
|
| 50 |
+
}} // namespace at::_ops
|
moondream/lib/python3.10/site-packages/torch/include/ATen/ops/addmv_cuda_dispatch.h
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
// @generated by torchgen/gen.py from DispatchKeyFunction.h
|
| 3 |
+
|
| 4 |
+
// NB: The implementing C++ file is RegisterDispatchKey.cpp
|
| 5 |
+
|
| 6 |
+
// The only #includes we need are for custom classes that have defaults in the C++ API
|
| 7 |
+
#include <c10/core/MemoryFormat.h>
|
| 8 |
+
#include <c10/core/Scalar.h>
|
| 9 |
+
#include <ATen/core/Reduction.h>
|
| 10 |
+
|
| 11 |
+
// Forward declarations of any types needed in the operator signatures.
|
| 12 |
+
// We can't directly include these classes because it will cause circular include dependencies.
|
| 13 |
+
// This file is included by TensorBody.h, which defines the Tensor class.
|
| 14 |
+
#include <ATen/core/ATen_fwd.h>
|
| 15 |
+
|
| 16 |
+
namespace at {
|
| 17 |
+
|
| 18 |
+
namespace cuda {
|
| 19 |
+
|
| 20 |
+
TORCH_API at::Tensor addmv(const at::Tensor & self, const at::Tensor & mat, const at::Tensor & vec, const at::Scalar & beta=1, const at::Scalar & alpha=1);
|
| 21 |
+
TORCH_API at::Tensor & addmv_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & mat, const at::Tensor & vec, const at::Scalar & beta=1, const at::Scalar & alpha=1);
|
| 22 |
+
TORCH_API at::Tensor & addmv_outf(const at::Tensor & self, const at::Tensor & mat, const at::Tensor & vec, const at::Scalar & beta, const at::Scalar & alpha, at::Tensor & out);
|
| 23 |
+
TORCH_API at::Tensor & addmv_(at::Tensor & self, const at::Tensor & mat, const at::Tensor & vec, const at::Scalar & beta=1, const at::Scalar & alpha=1);
|
| 24 |
+
|
| 25 |
+
} // namespace cuda
|
| 26 |
+
} // namespace at
|
moondream/lib/python3.10/site-packages/torch/include/ATen/ops/argmin_native.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// @generated by torchgen/gen.py from NativeFunction.h
|
| 4 |
+
|
| 5 |
+
#include <c10/core/Scalar.h>
|
| 6 |
+
#include <c10/core/Storage.h>
|
| 7 |
+
#include <c10/core/TensorOptions.h>
|
| 8 |
+
#include <c10/util/Deprecated.h>
|
| 9 |
+
#include <c10/util/Optional.h>
|
| 10 |
+
#include <c10/core/QScheme.h>
|
| 11 |
+
#include <ATen/core/Reduction.h>
|
| 12 |
+
#include <ATen/core/Tensor.h>
|
| 13 |
+
#include <tuple>
|
| 14 |
+
#include <vector>
|
| 15 |
+
#include <ATen/ops/argmin_meta.h>
|
| 16 |
+
|
| 17 |
+
namespace at {
|
| 18 |
+
namespace native {
|
| 19 |
+
struct TORCH_API structured_argmin_out : public at::meta::structured_argmin {
|
| 20 |
+
void impl(const at::Tensor & self, c10::optional<int64_t> dim, bool keepdim, const at::Tensor & out);
|
| 21 |
+
};
|
| 22 |
+
} // namespace native
|
| 23 |
+
} // namespace at
|
moondream/lib/python3.10/site-packages/torch/include/ATen/ops/asin_ops.h
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// @generated by torchgen/gen.py from Operator.h
|
| 4 |
+
|
| 5 |
+
#include <tuple>
|
| 6 |
+
#include <vector>
|
| 7 |
+
|
| 8 |
+
// Forward declarations of any types needed in the operator signatures.
|
| 9 |
+
// We can't directly include these classes because it will cause circular include dependencies.
|
| 10 |
+
// This file is included by TensorBody.h, which defines the Tensor class.
|
| 11 |
+
#include <ATen/core/ATen_fwd.h>
|
| 12 |
+
|
| 13 |
+
namespace at {
|
| 14 |
+
namespace _ops {
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
struct TORCH_API asin {
|
| 18 |
+
using schema = at::Tensor (const at::Tensor &);
|
| 19 |
+
using ptr_schema = schema*;
|
| 20 |
+
// See Note [static constexpr char* members for windows NVCC]
|
| 21 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::asin")
|
| 22 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "")
|
| 23 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "asin(Tensor self) -> Tensor")
|
| 24 |
+
static at::Tensor call(const at::Tensor & self);
|
| 25 |
+
static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self);
|
| 26 |
+
};
|
| 27 |
+
|
| 28 |
+
struct TORCH_API asin_ {
|
| 29 |
+
using schema = at::Tensor & (at::Tensor &);
|
| 30 |
+
using ptr_schema = schema*;
|
| 31 |
+
// See Note [static constexpr char* members for windows NVCC]
|
| 32 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::asin_")
|
| 33 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "")
|
| 34 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "asin_(Tensor(a!) self) -> Tensor(a!)")
|
| 35 |
+
static at::Tensor & call(at::Tensor & self);
|
| 36 |
+
static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, at::Tensor & self);
|
| 37 |
+
};
|
| 38 |
+
|
| 39 |
+
struct TORCH_API asin_out {
|
| 40 |
+
using schema = at::Tensor & (const at::Tensor &, at::Tensor &);
|
| 41 |
+
using ptr_schema = schema*;
|
| 42 |
+
// See Note [static constexpr char* members for windows NVCC]
|
| 43 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::asin")
|
| 44 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out")
|
| 45 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "asin.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)")
|
| 46 |
+
static at::Tensor & call(const at::Tensor & self, at::Tensor & out);
|
| 47 |
+
static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, at::Tensor & out);
|
| 48 |
+
};
|
| 49 |
+
|
| 50 |
+
}} // namespace at::_ops
|
moondream/lib/python3.10/site-packages/torch/include/ATen/ops/col_indices_ops.h
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// @generated by torchgen/gen.py from Operator.h
|
| 4 |
+
|
| 5 |
+
#include <tuple>
|
| 6 |
+
#include <vector>
|
| 7 |
+
|
| 8 |
+
// Forward declarations of any types needed in the operator signatures.
|
| 9 |
+
// We can't directly include these classes because it will cause circular include dependencies.
|
| 10 |
+
// This file is included by TensorBody.h, which defines the Tensor class.
|
| 11 |
+
#include <ATen/core/ATen_fwd.h>
|
| 12 |
+
|
| 13 |
+
namespace at {
|
| 14 |
+
namespace _ops {
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
struct TORCH_API col_indices {
|
| 18 |
+
using schema = at::Tensor (const at::Tensor &);
|
| 19 |
+
using ptr_schema = schema*;
|
| 20 |
+
// See Note [static constexpr char* members for windows NVCC]
|
| 21 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::col_indices")
|
| 22 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "")
|
| 23 |
+
STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "col_indices(Tensor(a) self) -> Tensor(a)")
|
| 24 |
+
static at::Tensor call(const at::Tensor & self);
|
| 25 |
+
static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self);
|
| 26 |
+
};
|
| 27 |
+
|
| 28 |
+
}} // namespace at::_ops
|