{ "info": { "author": "Klaus Greff", "author_email": "klaus.greff@startmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering", "Topic :: Utilities" ], "description": "# Shape Guard\n\nShapeGuard is a tool to help with handling shapes in Tensorflow.\n\n\n\n## Basic Usage\n```python\nimport tensorflow as tf\nfrom shapeguard import ShapeGuard\n\nsg = ShapeGuard()\n\nimg = tf.ones([64, 32, 32, 3])\nflat_img = tf.ones([64, 1024])\nlabels = tf.ones([64])\n\n# check shape consistency\nsg.guard(img, \"B, H, W, C\")\nsg.guard(labels, \"B, 1\") # raises error because of rank mismatch\nsg.guard(flat_img, \"B, H*W*C\") # raises error because 1024 != 32*32*3\n\n# guard also returns the tensor, so it can be inlined\nmean_img = sg.guard(tf.reduce_mean(img, axis=0), \"H, W, C\")\n\n# more readable reshapes\nflat_img = sg.reshape(img, 'B, H*W*C')\n\n# evaluate templates\nassert sg['H, W*C+1'] == [32, 97]\n\n# attribute access to inferred dimensions\nassert sg.B == 64\n```\n\n\n## Shape Template Syntax\nThe shape template mini-DSL supports many different ways of specifying shapes:\n\n * numbers: `\"64, 32, 32, 3\"`\n * named dimensions: `\"B, width, height2, channels\"`\n * wildcards: `\"B, *, *, *\"`\n * ellipsis: `\"B, ..., 3\"`\n * addition, subtraction, multiplication, division: `\"B*N, W/2, H*(C+1)\"`\n * dynamic dimensions: `\"?, H, W, C\"` *(only matches `[None, H, W, C]`)*\n\n---\n**DISCLAIMER**\n\nThis is not an officially supported Google product.\n\n---\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Qwlouse/shapeguard", "keywords": "", "license": "Apache-2.0", "maintainer": "Klaus Greff", "maintainer_email": "klaus.greff@startmail.com", "name": "shapeguard", "package_url": "https://pypi.org/project/shapeguard/", "platform": "", "project_url": "https://pypi.org/project/shapeguard/", "project_urls": { "Homepage": "https://github.com/Qwlouse/shapeguard", "Repository": "https://github.com/Qwlouse/shapeguard" }, "release_url": "https://pypi.org/project/shapeguard/0.1.1/", "requires_dist": [ "tensorflow (>=1.14,<2.0)", "numpy (>=1.17,<2.0)", "tensorflow-probability (>=0.7.0,<0.8.0)" ], "requires_python": ">=3.6,<4.0", "summary": "ShapeGuard is a tool to help with handling shapes in Tensorflow.", "version": "0.1.1" }, "last_serial": 5840429, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "49e606e3b7567b6612cd3dba1caddac6", "sha256": "915ac04985b1e29c4a2829d8bfd83abb3a96bd9eceafc776d6b3cca9646c9a22" }, "downloads": -1, "filename": "shapeguard-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "49e606e3b7567b6612cd3dba1caddac6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 32919, "upload_time": "2019-07-29T19:41:59", "url": "https://files.pythonhosted.org/packages/2d/ee/bf5bc22c7cba09adc7c8e15f209860041c04407c1f2545523e6b1d32d198/shapeguard-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3d7d9c90a270711c1881a251ede7dfae", "sha256": "d2c3f64aa023904010242a9fc5e17082c0681408de7c58981345d694c83175e4" }, "downloads": -1, "filename": "shapeguard-0.1.0.tar.gz", "has_sig": false, "md5_digest": "3d7d9c90a270711c1881a251ede7dfae", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 29232, "upload_time": "2019-07-29T19:42:02", "url": "https://files.pythonhosted.org/packages/85/57/08fd164171dd0b7b12ef22cd1536d109023a506c67a78c583416614d2181/shapeguard-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "55dde609c56ed93007a197b1076c71ce", "sha256": "a489d6a8a33cdc6b6f4a2f7bf9e59d2824699373ca77b1c91ac12bb44b85b990" }, "downloads": -1, "filename": "shapeguard-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "55dde609c56ed93007a197b1076c71ce", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 32930, "upload_time": "2019-09-17T09:04:54", "url": "https://files.pythonhosted.org/packages/e5/4c/4991b4503ad19de7a8d3586f97d8dab3ecf59541e649bac5218dbcd294cd/shapeguard-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8c8274965ac8e0c6edc9d086f6aa2bb2", "sha256": "0bd2a80a924acbf6d2fb07a6b2cbed742f7f9ecdfd77ee106ae5f48538abb31f" }, "downloads": -1, "filename": "shapeguard-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8c8274965ac8e0c6edc9d086f6aa2bb2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 29259, "upload_time": "2019-09-17T09:04:56", "url": "https://files.pythonhosted.org/packages/4d/44/ce6a7100f94556aa4692cc9b150a0b909ed7470672ca6f72a9b23f324dea/shapeguard-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "55dde609c56ed93007a197b1076c71ce", "sha256": "a489d6a8a33cdc6b6f4a2f7bf9e59d2824699373ca77b1c91ac12bb44b85b990" }, "downloads": -1, "filename": "shapeguard-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "55dde609c56ed93007a197b1076c71ce", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 32930, "upload_time": "2019-09-17T09:04:54", "url": "https://files.pythonhosted.org/packages/e5/4c/4991b4503ad19de7a8d3586f97d8dab3ecf59541e649bac5218dbcd294cd/shapeguard-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8c8274965ac8e0c6edc9d086f6aa2bb2", "sha256": "0bd2a80a924acbf6d2fb07a6b2cbed742f7f9ecdfd77ee106ae5f48538abb31f" }, "downloads": -1, "filename": "shapeguard-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8c8274965ac8e0c6edc9d086f6aa2bb2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 29259, "upload_time": "2019-09-17T09:04:56", "url": "https://files.pythonhosted.org/packages/4d/44/ce6a7100f94556aa4692cc9b150a0b909ed7470672ca6f72a9b23f324dea/shapeguard-0.1.1.tar.gz" } ] }