From 24ee8c58752f0dc4376961a28f7364e6d7c7a7aa Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 24 Feb 2024 17:40:43 +0000 Subject: gentoo auto-resync : 24:02:2024 - 17:40:43 --- sci-libs/tensorflow-estimator/Manifest | 7 - ...ude-extractor_wrapper-and-generator_wrapp.patch | 29 - ...te-TF-Estimator-to-use-new-TF-API-Generat.patch | 703 --------------------- sci-libs/tensorflow-estimator/metadata.xml | 16 - .../tensorflow-estimator-2.15.0.ebuild | 80 --- 5 files changed, 835 deletions(-) delete mode 100644 sci-libs/tensorflow-estimator/Manifest delete mode 100644 sci-libs/tensorflow-estimator/files/0001-Revert-Exclude-extractor_wrapper-and-generator_wrapp.patch delete mode 100644 sci-libs/tensorflow-estimator/files/0002-Revert-Update-TF-Estimator-to-use-new-TF-API-Generat.patch delete mode 100644 sci-libs/tensorflow-estimator/metadata.xml delete mode 100644 sci-libs/tensorflow-estimator/tensorflow-estimator-2.15.0.ebuild (limited to 'sci-libs/tensorflow-estimator') diff --git a/sci-libs/tensorflow-estimator/Manifest b/sci-libs/tensorflow-estimator/Manifest deleted file mode 100644 index d395d12263ef..000000000000 --- a/sci-libs/tensorflow-estimator/Manifest +++ /dev/null @@ -1,7 +0,0 @@ -AUX 0001-Revert-Exclude-extractor_wrapper-and-generator_wrapp.patch 1449 BLAKE2B a7ead50569e8dd70c98e11abe7203520fa6c55195b75576c2efbe68c43435d429b60173f3c05b2e8885f7931a770c7de042da70a7df1b075f02def366c08af5b SHA512 ae8961d088954a2ad4db3996f67b578ddf11a6bda43ae596b22b156fea05a9bcda0d048aa4eee45fd8ea2e5739ca753eef7afe04020370fe6093e4cd95aa3d64 -AUX 0002-Revert-Update-TF-Estimator-to-use-new-TF-API-Generat.patch 28494 BLAKE2B e1cb1cef771a81fd28375a8af02bfce9bf0109ff38666688a117cf6a095799c82e2b9a88dd2d42a811713778904165323a9b27950dbc0a29dca9597a4dcdb382 SHA512 63f74cb59a00f91e083bc0fc53c7646cf1f3943beaa7636a414c793a793a4bd156ce891941709706b69d91dff9532f2e72e1edd9457f69e6d2dad8380fab4772 -DIST bazelbuild-rules_cc-0.0.2.tar.gz 127138 BLAKE2B 2a4cb12096bd8e6efebb13861b259ea12266372d37ef0d6c6005c4b9a6f919c26e1caa2ac78578aefd80a4f5bf08c1a14e15df5218f5d6b949beacba116b7b33 SHA512 688b5e6ea0e4cc8e5e11fc7aaac70f88c54d2d70221df0772eea1f0ff3ec16e2e92305f76da09c3c497f29e9132870ceaec7ecad034cca678ff4303899b67c14 -DIST bazelbuild-rules_java-7cf3cefd652008d0a64a419c34c13bdca6c8f178.zip 9422 BLAKE2B bbc45c97551ee8126335b611ffca6574dac843d4db9b3221b10d26487f8eecfe38ba0cd67a4039a3ad921c25fea6294c43e4f4e7a57a060a30791acd6c4f9d39 SHA512 ba06242feb711e7fb6e821fd9ac029248b4f3e466fb1acf971d0db8196f3efe4d114ef137acbe4913073f8cbe8ccab4d47d8bafa21b867b2d6a6d57f5a647f0c -DIST tensorflow-estimator-2.15.0.tar.gz 658541 BLAKE2B 519ccab7f77a3074009b3b9d24f18267abece981dc33a7716cd916b388a4306183221ec12ddb3e32ac41cbe30d936dc504d931a612b71d35093d27def5d391e8 SHA512 129fe36ee63932b324d8ee77f917d4ded99be2e645e0884bd920bebf703b63889ed72b76b14fcc3aa8f9cfd0b465428d67067fcfc43f2c761a101ea56d574d04 -EBUILD tensorflow-estimator-2.15.0.ebuild 1991 BLAKE2B f94c45271ea2b13529d2daf2f81722a0cd69326c6005039f5eb080812982fe74523704863e191377780069f4b3c9d267337b9343d911d14ae05d2676b97961b7 SHA512 3ef8ea27ffb9bacf6a56ea0a2adf76c7ecd7474f4a89eac85fb0aa4ef06dee5a9f5b2ac579255f2c0ebb452fcc3fc84d81bfaea474d3593d2c3493782173a55a -MISC metadata.xml 581 BLAKE2B f3c4be0d25d3337871d9fc5f0d2e1e420fd68f45c2a7fbabaab0557f2f323661d4dd1ab847778ccc5a06bfe86a6fcf77bc4f65a04baa8ed569fd868ca8a03009 SHA512 41e7c5f2bce2166ed98259fa86fcf92cb3e2e186e7387a1cc75d630313791fc83e297288ce52ad25655292eb14b28a651dec3cb6b3101c75c327f447b15d6293 diff --git a/sci-libs/tensorflow-estimator/files/0001-Revert-Exclude-extractor_wrapper-and-generator_wrapp.patch b/sci-libs/tensorflow-estimator/files/0001-Revert-Exclude-extractor_wrapper-and-generator_wrapp.patch deleted file mode 100644 index cc44a9592d96..000000000000 --- a/sci-libs/tensorflow-estimator/files/0001-Revert-Exclude-extractor_wrapper-and-generator_wrapp.patch +++ /dev/null @@ -1,29 +0,0 @@ -From f6d965a9f81b3062ca2f9194bcfa52ee4eeec928 Mon Sep 17 00:00:00 2001 -From: wangjiezhe -Date: Sat, 23 Dec 2023 10:06:57 +0800 -Subject: [PATCH 1/2] Revert "Exclude `extractor_wrapper` and - `generator_wrapper` from the pip package, and remove the exclusion for the - deleted `create_python_api_wrapper`." - -This reverts commit bd50049c3905fd8c9ad058d2e09682b45b9b9b02. ---- - tensorflow_estimator/tools/pip_package/create_pip_helper.py | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/tensorflow_estimator/tools/pip_package/create_pip_helper.py b/tensorflow_estimator/tools/pip_package/create_pip_helper.py -index 4810594..e1b1f27 100644 ---- a/tensorflow_estimator/tools/pip_package/create_pip_helper.py -+++ b/tensorflow_estimator/tools/pip_package/create_pip_helper.py -@@ -35,8 +35,7 @@ PIP_EXCLUDED_FILES = frozenset([ - 'tensorflow_estimator/python/estimator/canned/v1/baseline_test_v1.py', - 'tensorflow_estimator/python/estimator/canned/v1/dnn_test_fc_v1_v1.py', - 'tensorflow_estimator/python/estimator/canned/v1/dnn_test_fc_v2_v1.py', -- 'tensorflow_estimator/python/estimator/api/extractor_wrapper.py', -- 'tensorflow_estimator/python/estimator/api/generator_wrapper.py', -+ 'tensorflow_estimator/python/estimator/api/create_python_api_wrapper.py', - 'tensorflow_estimator/tools/pip_package/setup.py', - 'tensorflow_estimator/tools/pip_package/create_pip_helper.py', - ]) --- -2.41.0 - diff --git a/sci-libs/tensorflow-estimator/files/0002-Revert-Update-TF-Estimator-to-use-new-TF-API-Generat.patch b/sci-libs/tensorflow-estimator/files/0002-Revert-Update-TF-Estimator-to-use-new-TF-API-Generat.patch deleted file mode 100644 index d7167adb8488..000000000000 --- a/sci-libs/tensorflow-estimator/files/0002-Revert-Update-TF-Estimator-to-use-new-TF-API-Generat.patch +++ /dev/null @@ -1,703 +0,0 @@ -From 38076a1b48096ef7b4f1e5005fdf9e14425d56a8 Mon Sep 17 00:00:00 2001 -From: wangjiezhe -Date: Sat, 23 Dec 2023 10:07:02 +0800 -Subject: [PATCH 2/2] Revert "Update TF Estimator to use new TF API Generator" - -This reverts commit f7653f9adf978acb3bd459e6ec779a659f1f9a2a. ---- - tensorflow_estimator/BUILD | 14 +- - .../python/estimator/api/BUILD | 48 +- - .../python/estimator/api/api_gen.bzl | 422 ++++-------------- - .../api/create_python_api_wrapper.py | 30 ++ - .../python/estimator/api/extractor_wrapper.py | 21 - - .../python/estimator/api/generator_wrapper.py | 20 - - 6 files changed, 155 insertions(+), 400 deletions(-) - create mode 100644 tensorflow_estimator/python/estimator/api/create_python_api_wrapper.py - delete mode 100644 tensorflow_estimator/python/estimator/api/extractor_wrapper.py - delete mode 100644 tensorflow_estimator/python/estimator/api/generator_wrapper.py - -diff --git a/tensorflow_estimator/BUILD b/tensorflow_estimator/BUILD -index 680cc4e..037c7a9 100644 ---- a/tensorflow_estimator/BUILD -+++ b/tensorflow_estimator/BUILD -@@ -5,7 +5,7 @@ load( - "//tensorflow_estimator/python/estimator/api:api_gen.bzl", - "ESTIMATOR_API_INIT_FILES_V1", - "ESTIMATOR_API_INIT_FILES_V2", -- "generate_apis", -+ "gen_api_init_files", - ) - - licenses(["notice"]) -@@ -67,17 +67,17 @@ py_library( - genrule( - name = "root_init_gen", - srcs = select({ -- "api_version_2": ["_api/v2/v2.py"], -- "//conditions:default": ["_api/v1/v1.py"], -+ "api_version_2": [":estimator_python_api_gen_compat_v2"], -+ "//conditions:default": [":estimator_python_api_gen_compat_v1"], - }), - outs = ["__init__.py"], - cmd = select({ -- "api_version_2": "cp $(location :_api/v2/v2.py) $(OUTS)", -- "//conditions:default": "cp $(location :_api/v1/v1.py) $(OUTS)", -+ "api_version_2": "cp $(@D)/_api/v2/v2.py $(OUTS)", -+ "//conditions:default": "cp $(@D)/_api/v1/v1.py $(OUTS)", - }), - ) - --generate_apis( -+gen_api_init_files( - name = "estimator_python_api_gen_compat_v1", - api_version = 1, - output_dir = "_api/v1/", -@@ -86,7 +86,7 @@ generate_apis( - root_file_name = "v1.py", - ) - --generate_apis( -+gen_api_init_files( - name = "estimator_python_api_gen_compat_v2", - api_version = 2, - output_dir = "_api/v2/", -diff --git a/tensorflow_estimator/python/estimator/api/BUILD b/tensorflow_estimator/python/estimator/api/BUILD -index 01dce90..96ac567 100644 ---- a/tensorflow_estimator/python/estimator/api/BUILD -+++ b/tensorflow_estimator/python/estimator/api/BUILD -@@ -1,10 +1,17 @@ --# Placeholder: load aliased py_binary --load("//tensorflow_estimator/python/estimator/api:api_gen.bzl", "ESTIMATOR_API_INIT_FILES_V1", "ESTIMATOR_API_INIT_FILES_V2", "generate_apis") -- - package(default_visibility = ["//tensorflow_estimator:internal"]) - - licenses(["notice"]) - -+load("//tensorflow_estimator/python/estimator/api:api_gen.bzl", "gen_api_init_files") -+load("//tensorflow_estimator/python/estimator/api:api_gen.bzl", "ESTIMATOR_API_INIT_FILES_V1") -+load("//tensorflow_estimator/python/estimator/api:api_gen.bzl", "ESTIMATOR_API_INIT_FILES_V2") -+ -+exports_files( -+ [ -+ "create_python_api_wrapper.py", -+ ], -+) -+ - # This flag specifies whether Estimator 2.0 API should be built instead - # of 1.* API. Note that Estimator 2.0 API is currently under development. - config_setting( -@@ -12,53 +19,36 @@ config_setting( - define_values = {"estimator_api_version": "2"}, - ) - --py_binary( -- name = "extractor_wrapper", -- srcs = ["extractor_wrapper.py"], -- visibility = ["//visibility:public"], -- deps = [ -- "//tensorflow_estimator/python/estimator:expect_absl_installed", # absl:app -- ], --) -- --py_binary( -- name = "generator_wrapper", -- srcs = ["generator_wrapper.py"], -- visibility = ["//visibility:public"], -- deps = [ -- "//tensorflow_estimator/python/estimator:expect_absl_installed", # absl:app -- ], --) -- - genrule( - name = "estimator_python_api_gen", - srcs = select({ -- "api_version_2": ["_v2/v2.py"], -- "//conditions:default": ["_v1/v1.py"], -+ "api_version_2": [":estimator_python_api_gen_compat_v2"], -+ "//conditions:default": [":estimator_python_api_gen_compat_v1"], - }), - outs = ["__init__.py"], - cmd = select({ -- "api_version_2": "cp $(location :_v2/v2.py) $(OUTS)", -- "//conditions:default": "cp $(location :_v1/v1.py) $(OUTS)", -+ # Copy the right init file and replace 'from . import' -+ # with 'from ._vN import'. -+ "api_version_2": "cp $(@D)/_v2/v2.py $(OUTS) && sed -i'.original' 's/from . import/from ._v2 import/g' $(OUTS)", -+ "//conditions:default": "cp $(@D)/_v1/v1.py $(OUTS) && sed -i'.original' 's/from . import/from ._v1 import/g' $(OUTS)", - }), -+ visibility = ["//visibility:public"], - ) - --generate_apis( -+gen_api_init_files( - name = "estimator_python_api_gen_compat_v1", - api_version = 1, - output_dir = "_v1/", - output_files = ESTIMATOR_API_INIT_FILES_V1, - output_package = "tensorflow_estimator.python.estimator.api._v1", - root_file_name = "v1.py", -- visibility = ["//visibility:public"], - ) - --generate_apis( -+gen_api_init_files( - name = "estimator_python_api_gen_compat_v2", - api_version = 2, - output_dir = "_v2/", - output_files = ESTIMATOR_API_INIT_FILES_V2, - output_package = "tensorflow_estimator.python.estimator.api._v2", - root_file_name = "v2.py", -- visibility = ["//visibility:public"], - ) -diff --git a/tensorflow_estimator/python/estimator/api/api_gen.bzl b/tensorflow_estimator/python/estimator/api/api_gen.bzl -index b8eaf84..87dd65b 100644 ---- a/tensorflow_estimator/python/estimator/api/api_gen.bzl -+++ b/tensorflow_estimator/python/estimator/api/api_gen.bzl -@@ -1,7 +1,7 @@ --"""Targets for generating TensorFlow Estimator Python API __init__.py files. -+"""Targets for generating TensorFlow Python API __init__.py files. - - This bzl file is copied with slight modifications from --tensorflow/python/tools/api/generator2/generate_api.bzl -+tensorflow/python/estimator/api/api_gen.bzl - so that we can avoid needing to depend on TF source code in Bazel build. - - It should be noted that because this file is executed during the build, -@@ -10,15 +10,7 @@ is required to Bazel build Estimator. - """ - - load("//tensorflow_estimator:estimator.bzl", "if_indexing_source_code") -- --_TARGET_PATTERNS = [ -- "//tensorflow_estimator:", -- "//tensorflow_estimator/", --] -- --_DECORATOR = "tensorflow_estimator.python.estimator.estimator_export.estimator_export" -- --_MODULE_PREFIX = "" -+# Placeholder: load aliased py_binary - - ESTIMATOR_API_INIT_FILES_V1 = [ - "__init__.py", -@@ -38,332 +30,116 @@ ESTIMATOR_API_INIT_FILES_V2 = [ - "estimator/inputs/__init__.py", - ] - --def _any_match(label): -- full_target = "//" + label.package + ":" + label.name -- for pattern in _TARGET_PATTERNS: -- if pattern in full_target: -- return True -- return False -- --def _join(path, *others): -- result = path -- -- for p in others: -- if not result or result.endswith("/"): -- result += p -- else: -- result += "/" + p -- -- return result -- --def _api_info_init(*, transitive_api): -- if type(transitive_api) != type(depset()): -- fail("ApiInfo.transitive_api must be a depset") -- return {"transitive_api": transitive_api} -- --ApiInfo, _new_api_info = provider( -- doc = "Provider for API symbols and docstrings extracted from Python files.", -- fields = { -- "transitive_api": "depset of files with extracted API.", -- }, -- init = _api_info_init, --) -- --def _py_files(f): -- if f.basename.endswith(".py") or f.basename.endswith(".py3"): -- return f.path -- return None -- --def _merge_py_info( -- deps, -- direct_sources = None, -- direct_imports = None, -- has_py2_only_sources = False, -- has_py3_only_sources = False, -- uses_shared_libraries = False): -- transitive_sources = [] -- transitive_imports = [] -- for dep in deps: -- if PyInfo in dep: -- transitive_sources.append(dep[PyInfo].transitive_sources) -- transitive_imports.append(dep[PyInfo].imports) -- has_py2_only_sources = has_py2_only_sources or dep[PyInfo].has_py2_only_sources -- has_py3_only_sources = has_py3_only_sources or dep[PyInfo].has_py3_only_sources -- uses_shared_libraries = uses_shared_libraries or dep[PyInfo].uses_shared_libraries -- -- return PyInfo( -- transitive_sources = depset(direct = direct_sources, transitive = transitive_sources), -- imports = depset(direct = direct_imports, transitive = transitive_imports), -- has_py2_only_sources = has_py2_only_sources, -- has_py3_only_sources = has_py3_only_sources, -- uses_shared_libraries = uses_shared_libraries, -- ) -- --def _merge_api_info( -- deps, -- direct_api = None): -- transitive_api = [] -- for dep in deps: -- if ApiInfo in dep: -- transitive_api.append(dep[ApiInfo].transitive_api) -- return ApiInfo(transitive_api = depset(direct = direct_api, transitive = transitive_api)) -- --def _api_extractor_impl(target, ctx): -- direct_api = [] -- -- # Make sure the rule has a non-empty srcs attribute. -- if ( -- _any_match(target.label) and -- hasattr(ctx.rule.attr, "srcs") and -- ctx.rule.attr.srcs -- ): -- output = ctx.actions.declare_file("_".join([ -- target.label.name, -- "extracted_tensorflow_estimator_api.json", -- ])) -- -- args = ctx.actions.args() -- args.set_param_file_format("multiline") -- args.use_param_file("--flagfile=%s") -- -- args.add("--output", output) -- args.add("--decorator", _DECORATOR) -- args.add("--api_name", "tensorflow_estimator") -- args.add_all(ctx.rule.files.srcs, expand_directories = True, map_each = _py_files) -- -- ctx.actions.run( -- mnemonic = "ExtractAPI", -- executable = ctx.executable._extractor_bin, -- inputs = ctx.rule.files.srcs, -- outputs = [output], -- arguments = [args], -- progress_message = "Extracting tensorflow_estimator APIs for %{label} to %{output}.", -- ) -- -- direct_api.append(output) -- -- return [ -- _merge_api_info(ctx.rule.attr.deps if hasattr(ctx.rule.attr, "deps") else [], direct_api = direct_api), -- ] -- --api_extractor = aspect( -- doc = "Extracts the exported API for the given target and its dependencies.", -- implementation = _api_extractor_impl, -- attr_aspects = ["deps"], -- provides = [ApiInfo], -- # Currently the Python rules do not correctly advertise their providers. -- # required_providers = [PyInfo], -- attrs = { -- "_extractor_bin": attr.label( -- default = Label("//tensorflow_estimator/python/estimator/api:extractor_wrapper"), -- executable = True, -- cfg = "exec", -- ), -- }, --) -- --def _extract_api_impl(ctx): -- return [ -- _merge_api_info(ctx.attr.deps), -- _merge_py_info(ctx.attr.deps), -- ] -- --extract_api = rule( -- doc = "Extract Python API for all targets in transitive dependencies.", -- implementation = _extract_api_impl, -- attrs = { -- "deps": attr.label_list( -- doc = "Targets to extract API from.", -- allow_empty = False, -- aspects = [api_extractor], -- providers = [PyInfo], -- mandatory = True, -- ), -- }, -- provides = [ApiInfo, PyInfo], --) -- --def _generate_api_impl(ctx): -- args = ctx.actions.args() -- args.set_param_file_format("multiline") -- args.use_param_file("--flagfile=%s") -- -- args.add_joined("--output_files", ctx.outputs.output_files, join_with = ",") -- args.add("--output_dir", _join(ctx.bin_dir.path, ctx.label.package, ctx.attr.output_dir)) -- if ctx.file.root_init_template: -- args.add("--root_init_template", ctx.file.root_init_template) -- args.add("--apiversion", ctx.attr.api_version) -- args.add_joined("--compat_api_versions", ctx.attr.compat_api_versions, join_with = ",") -- args.add_joined("--compat_init_templates", ctx.files.compat_init_templates, join_with = ",") -- args.add("--output_package", ctx.attr.output_package) -- args.add_joined("--packages_to_ignore", ctx.attr.packages_to_ignore, join_with = ",") -- if _MODULE_PREFIX: -- args.add("--module_prefix", _MODULE_PREFIX) -- if ctx.attr.use_lazy_loading: -- args.add("--use_lazy_loading") -- else: -- args.add("--nouse_lazy_loading") -- if ctx.attr.proxy_module_root: -- args.add("--proxy_module_root", ctx.attr.proxy_module_root) -- args.add_joined("--file_prefixes_to_strip", [ctx.bin_dir.path, ctx.genfiles_dir.path], join_with = ",") -- if ctx.attr.root_file_name: -- args.add("--root_file_name", ctx.attr.root_file_name) -- -- inputs = depset(transitive = [ -- dep[ApiInfo].transitive_api -- for dep in ctx.attr.deps -- ]) -- args.add_all( -- inputs, -- expand_directories = True, -- ) -- -- transitive_inputs = [inputs] -- if ctx.attr.root_init_template: -- transitive_inputs.append(ctx.attr.root_init_template.files) -- -- ctx.actions.run( -- mnemonic = "GenerateAPI", -- executable = ctx.executable._generator_bin, -- inputs = depset( -- direct = ctx.files.compat_init_templates, -- transitive = transitive_inputs, -- ), -- outputs = ctx.outputs.output_files, -- arguments = [args], -- progress_message = "Generating APIs for %{label} to %{output}.", -- ) -- --generate_api = rule( -- doc = "Generate Python API for all targets in transitive dependencies.", -- implementation = _generate_api_impl, -- attrs = { -- "deps": attr.label_list( -- doc = "extract_api targets to generate API from.", -- allow_empty = True, -- providers = [ApiInfo, PyInfo], -- mandatory = True, -- ), -- "root_init_template": attr.label( -- doc = "Template for the top level __init__.py file", -- allow_single_file = True, -- ), -- "api_version": attr.int( -- doc = "The API version to generate (1 or 2)", -- values = [1, 2], -- ), -- "compat_api_versions": attr.int_list( -- doc = "Additional versions to generate in compat/ subdirectory.", -- ), -- "compat_init_templates": attr.label_list( -- doc = "Template for top-level __init__files under compat modules. This list must be " + -- "in the same order as the list of versions in compat_apiversions", -- allow_files = True, -- ), -- "output_package": attr.string( -- doc = "Root output package.", -- ), -- "output_dir": attr.string( -- doc = "Subdirectory to output API to. If non-empty, must end with '/'.", -- ), -- "proxy_module_root": attr.string( -- doc = "Module root for proxy-import format. If specified, proxy files with " + -- "`from proxy_module_root.proxy_module import *` will be created to enable " + -- "import resolution under TensorFlow.", -- ), -- "output_files": attr.output_list( -- doc = "List of __init__.py files that should be generated. This list should include " + -- "file name for every module exported using tf_export. For e.g. if an op is " + -- "decorated with @tf_export('module1.module2', 'module3'). Then, output_files " + -- "should include module1/module2/__init__.py and module3/__init__.py.", -- ), -- "use_lazy_loading": attr.bool( -- doc = "If true, lazy load imports in the generated API rather then imporing them all statically.", -- ), -- "packages_to_ignore": attr.string_list( -- doc = "List of packages to ignore tf_exports from.", -- ), -- "root_file_name": attr.string( -- doc = "The file name that should be generated for the top level API.", -- ), -- "_generator_bin": attr.label( -- default = Label("//tensorflow_estimator/python/estimator/api:generator_wrapper"), -- executable = True, -- cfg = "exec", -- ), -- }, --) -- --def generate_apis( -+def gen_api_init_files( - name, -- deps = [ -+ output_files, -+ root_init_template = None, -+ srcs = [], -+ api_name = "estimator", -+ api_version = 2, -+ compat_api_versions = [], -+ compat_init_templates = [], -+ packages = ["tensorflow_estimator.python.estimator"], -+ package_deps = [ - "//tensorflow_estimator/python/estimator:estimator_py", - # "//third_party/tensorflow/lite/python:analyzer", - # "//third_party/tensorflow/lite/python:lite", - # "//third_party/tensorflow/lite/python/authoring", - ], -- output_files = ESTIMATOR_API_INIT_FILES_V2, -- root_init_template = None, -- api_version = 2, -- compat_api_versions = [], -- compat_init_templates = [], - output_package = "tensorflow_estimator.python.estimator.api", - output_dir = "", -- proxy_module_root = None, -- packages_to_ignore = [], -- root_file_name = "__init__.py", -- visibility = ["//visibility:private"]): -- """Generate TensorFlow APIs for a set of libraries. -+ root_file_name = "__init__.py"): -+ """Creates API directory structure and __init__.py files. -+ -+ Creates a genrule that generates a directory structure with __init__.py -+ files that import all exported modules (i.e. modules with tf_export -+ decorators). - - Args: -- name: name of generate_api target. -- deps: python_library targets to serve as roots for extracting APIs. -- output_files: The list of files that the API generator is exected to create. -- root_init_template: The template for the top level __init__.py file generated. -- "#API IMPORTS PLACEHOLDER" comment will be replaced with imports. -- api_version: THhe API version to generate. (1 or 2) -- compat_api_versions: Additional versions to generate in compat/ subdirectory. -- compat_init_templates: Template for top level __init__.py files under the compat modules. -- The list must be in the same order as the list of versions in 'compat_api_versions' -- output_package: Root output package. -- output_dir: Directory where the generated output files are placed. This should be a prefix -- of every directory in 'output_files' -- proxy_module_root: Module root for proxy-import format. If specified, proxy files with -- `from proxy_module_root.proxy_module import *` will be created to enable import -- resolution under TensorFlow. -- packages_to_ignore: List of packages to ignore tf_exports from. -- root_file_name: The file name that should be generated for the top level API. -- visibility: Visibility of the target containing the generated files. -+ name: name of genrule to create. -+ output_files: List of __init__.py files that should be generated. -+ This list should include file name for every module exported using -+ tf_export. For e.g. if an op is decorated with -+ @tf_export('module1.module2', 'module3'). Then, output_files should -+ include module1/module2/__init__.py and module3/__init__.py. -+ root_init_template: Python init file that should be used as template for -+ root __init__.py file. "# API IMPORTS PLACEHOLDER" comment inside this -+ template will be replaced with root imports collected by this genrule. -+ srcs: genrule sources. If passing root_init_template, the template file -+ must be included in sources. -+ api_name: Name of the project that you want to generate API files for -+ (e.g. "tensorflow" or "estimator"). -+ api_version: TensorFlow API version to generate. Must be either 1 or 2. -+ compat_api_versions: Older TensorFlow API versions to generate under -+ compat/ directory. -+ compat_init_templates: Python init file that should be used as template -+ for top level __init__.py files under compat/vN directories. -+ "# API IMPORTS PLACEHOLDER" comment inside this -+ template will be replaced with root imports collected by this genrule. -+ packages: Python packages containing the @tf_export decorators you want to -+ process -+ package_deps: Python library target containing your packages. -+ output_package: Package where generated API will be added to. -+ output_dir: Subdirectory to output API to. -+ If non-empty, must end with '/'. -+ root_file_name: Name of the root file with all the root imports. - """ -- extract_name = name + ".extract-tensorflow-estimator" -- extract_api( -- name = extract_name, -- deps = deps, -- visibility = ["//visibility:private"], -+ root_init_template_flag = "" -+ if root_init_template: -+ root_init_template_flag = "--root_init_template=$(location " + root_init_template + ")" -+ -+ primary_package = packages[0] -+ api_gen_binary_target = ("create_" + primary_package + "_api_%d_%s") % (api_version, name) -+ native.py_binary( -+ name = api_gen_binary_target, -+ srcs = ["//tensorflow_estimator/python/estimator/api:create_python_api_wrapper.py"], -+ main = "//tensorflow_estimator/python/estimator/api:create_python_api_wrapper.py", -+ python_version = "PY3", -+ srcs_version = "PY3", -+ visibility = ["//visibility:public"], -+ deps = package_deps, - ) - -- if proxy_module_root != None: -- # Avoid conflicts between the __init__.py file of TensorFlow and proxy module. -- output_files = [f for f in output_files if f != "__init__.py"] -- -- if root_file_name != None: -- output_files = [f if f != "__init__.py" else root_file_name for f in output_files] -+ # Replace name of root file with root_file_name. -+ output_files = [ -+ root_file_name if f == "__init__.py" else f -+ for f in output_files -+ ] -+ all_output_files = ["%s%s" % (output_dir, f) for f in output_files] -+ compat_api_version_flags = "" -+ for compat_api_version in compat_api_versions: -+ compat_api_version_flags += " --compat_apiversion=%d" % compat_api_version -+ -+ compat_init_template_flags = "" -+ for compat_init_template in compat_init_templates: -+ compat_init_template_flags += ( -+ " --compat_init_template=$(location %s)" % compat_init_template -+ ) - -- all_output_files = [_join(output_dir, f) for f in output_files] -+ flags = [ -+ root_init_template_flag, -+ "--apidir=$(@D)" + output_dir, -+ "--apiname=" + api_name, -+ "--apiversion=" + str(api_version), -+ compat_api_version_flags, -+ compat_init_template_flags, -+ "--packages=" + ",".join(packages), -+ "--output_package=" + output_package, -+ ] - -- generate_api( -+ native.genrule( - name = name, -- deps = [":" + extract_name], -- output_files = all_output_files, -- output_dir = output_dir, -- root_init_template = root_init_template, -- compat_api_versions = compat_api_versions, -- compat_init_templates = compat_init_templates, -- api_version = api_version, -- proxy_module_root = proxy_module_root, -- visibility = visibility, -- packages_to_ignore = packages_to_ignore, -- use_lazy_loading = False, -- output_package = output_package, -- root_file_name = root_file_name, -+ outs = all_output_files, -+ cmd = if_indexing_source_code( -+ _make_cmd(api_gen_binary_target, flags, loading = "static"), -+ _make_cmd(api_gen_binary_target, flags, loading = "default"), -+ ), -+ srcs = srcs, -+ tools = [":" + api_gen_binary_target], -+ visibility = ["//visibility:public"], - ) -+ -+def _make_cmd(api_gen_binary_target, flags, loading = "default"): -+ binary = "$(location :" + api_gen_binary_target + ")" -+ flags.append("--loading=" + loading) -+ return " ".join([binary] + flags + ["$(OUTS)"]) -diff --git a/tensorflow_estimator/python/estimator/api/create_python_api_wrapper.py b/tensorflow_estimator/python/estimator/api/create_python_api_wrapper.py -new file mode 100644 -index 0000000..9d52a02 ---- /dev/null -+++ b/tensorflow_estimator/python/estimator/api/create_python_api_wrapper.py -@@ -0,0 +1,30 @@ -+# Copyright 2018 The TensorFlow Authors. All Rights Reserved. -+# -+# Licensed under the Apache License, Version 2.0 (the "License"); -+# you may not use this file except in compliance with the License. -+# You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, software -+# distributed under the License is distributed on an "AS IS" BASIS, -+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+# See the License for the specific language governing permissions and -+# limitations under the License. -+# ============================================================================== -+"""Thin wrapper to call TensorFlow's API generation script. -+ -+This file exists to provide a main function for the py_binary in the API -+generation genrule. It just calls the main function for the actual API -+generation script in TensorFlow. -+""" -+ -+from __future__ import absolute_import -+from __future__ import division -+from __future__ import print_function -+ -+from tensorflow_estimator.python.estimator import estimator_lib # pylint: disable=unused-import -+from tensorflow.python.tools.api.generator import create_python_api -+ -+if __name__ == '__main__': -+ create_python_api.main() -diff --git a/tensorflow_estimator/python/estimator/api/extractor_wrapper.py b/tensorflow_estimator/python/estimator/api/extractor_wrapper.py -deleted file mode 100644 -index 884fcba..0000000 ---- a/tensorflow_estimator/python/estimator/api/extractor_wrapper.py -+++ /dev/null -@@ -1,21 +0,0 @@ --# Copyright 2023 The TensorFlow Authors. All Rights Reserved. --# --# Licensed under the Apache License, Version 2.0 (the "License"); --# you may not use this file except in compliance with the License. --# You may obtain a copy of the License at --# --# http://www.apache.org/licenses/LICENSE-2.0 --# --# Unless required by applicable law or agreed to in writing, software --# distributed under the License is distributed on an "AS IS" BASIS, --# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --# See the License for the specific language governing permissions and --# limitations under the License. --# ============================================================================== --"""Thin wrapper to call TensorFlow's API extractor script.""" --from absl import app -- --from tensorflow.python.tools.api.generator2.extractor import extractor -- --if __name__ == "__main__": -- app.run(extractor.main) -diff --git a/tensorflow_estimator/python/estimator/api/generator_wrapper.py b/tensorflow_estimator/python/estimator/api/generator_wrapper.py -deleted file mode 100644 -index ffcd49a..0000000 ---- a/tensorflow_estimator/python/estimator/api/generator_wrapper.py -+++ /dev/null -@@ -1,20 +0,0 @@ --# Copyright 2023 The TensorFlow Authors. All Rights Reserved. --# --# Licensed under the Apache License, Version 2.0 (the "License"); --# you may not use this file except in compliance with the License. --# You may obtain a copy of the License at --# --# http://www.apache.org/licenses/LICENSE-2.0 --# --# Unless required by applicable law or agreed to in writing, software --# distributed under the License is distributed on an "AS IS" BASIS, --# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --# See the License for the specific language governing permissions and --# limitations under the License. --# ============================================================================== --"""Thin wrapper to call TensorFlow's API generator script.""" --from absl import app --from tensorflow.python.tools.api.generator2.generator import generator -- --if __name__ == "__main__": -- app.run(generator.main) --- -2.41.0 - diff --git a/sci-libs/tensorflow-estimator/metadata.xml b/sci-libs/tensorflow-estimator/metadata.xml deleted file mode 100644 index db4dc8444e40..000000000000 --- a/sci-libs/tensorflow-estimator/metadata.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - perfinion@gentoo.org - Jason Zaman - - - TensorFlow Estimator is a high-level TensorFlow API that greatly - simplifies machine learning programming. Estimators encapsulate - training, evaluation, prediction, and exporting for your model. - - - tensorflow/estimator - - diff --git a/sci-libs/tensorflow-estimator/tensorflow-estimator-2.15.0.ebuild b/sci-libs/tensorflow-estimator/tensorflow-estimator-2.15.0.ebuild deleted file mode 100644 index 662af9932208..000000000000 --- a/sci-libs/tensorflow-estimator/tensorflow-estimator-2.15.0.ebuild +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..11} ) -MY_PN="estimator" -MY_PV=${PV/_rc/-rc} -MY_P=${MY_PN}-${MY_PV} - -inherit bazel distutils-r1 - -DESCRIPTION="A high-level TensorFlow API that greatly simplifies machine learning programming" -HOMEPAGE="https://www.tensorflow.org/" - -LICENSE="Apache-2.0" -SLOT="0" -KEYWORDS="~amd64" - -bazel_external_uris=" - https://github.com/bazelbuild/rules_cc/releases/download/0.0.2/rules_cc-0.0.2.tar.gz -> bazelbuild-rules_cc-0.0.2.tar.gz - https://github.com/bazelbuild/rules_java/archive/7cf3cefd652008d0a64a419c34c13bdca6c8f178.zip -> bazelbuild-rules_java-7cf3cefd652008d0a64a419c34c13bdca6c8f178.zip" - -SRC_URI="https://github.com/tensorflow/${MY_PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz - ${bazel_external_uris}" - -RDEPEND=" - =sci-libs/tensorflow-2.15*[python,${PYTHON_USEDEP}] - sci-libs/keras[${PYTHON_USEDEP}]" -DEPEND="${RDEPEND}" -BDEPEND=" - app-arch/unzip - >=dev-build/bazel-5.3.0 - dev-java/java-config -" - -S="${WORKDIR}/${MY_P}" - -DOCS=( CONTRIBUTING.md README.md ) - -PATCHES=( - "${FILESDIR}"/0001-Revert-Exclude-extractor_wrapper-and-generator_wrapp.patch - "${FILESDIR}"/0002-Revert-Update-TF-Estimator-to-use-new-TF-API-Generat.patch -) - -src_unpack() { - unpack "${P}.tar.gz" - bazel_load_distfiles "${bazel_external_uris}" -} - -src_prepare() { - bazel_setup_bazelrc - default - python_copy_sources -} - -python_compile() { - pushd "${BUILD_DIR}" >/dev/null || die - - ebazel build //tensorflow_estimator/tools/pip_package:build_pip_package - ebazel shutdown - - local srcdir="${T}/src-${EPYTHON/./_}" - mkdir -p "${srcdir}" || die - bazel-bin/tensorflow_estimator/tools/pip_package/build_pip_package --src "${srcdir}" || die - - popd >/dev/null || die -} - -src_compile() { - export JAVA_HOME=$(java-config --jre-home) - distutils-r1_src_compile -} - -python_install() { - pushd "${T}/src-${EPYTHON/./_}" >/dev/null || die - esetup.py install - python_optimize - popd >/dev/null || die -} -- cgit v1.2.3