MyGit

google-deepmind/tree

Fork: 59 Star: 937 (更新于 2024-10-24 11:21:07)

license: Apache-2.0

Language: Python .

tree is a library for working with nested data structures

最后发布版本: 0.1.8 ( 2022-12-18 17:35:28)

官方网址 GitHub网址

Tree

tree is a library for working with nested data structures. In a way, tree generalizes the builtin map function which only supports flat sequences, and allows to apply a function to each "leaf" preserving the overall structure.

>>> import tree
>>> structure = [[1], [[[2, 3]]], [4]]
>>> tree.flatten(structure)
[1, 2, 3, 4]
>>> tree.map_structure(lambda v: v**2, structure)
[[1], [[[4, 9]]], [16]]

tree is backed by an optimized C++ implementation suitable for use in demanding applications, such as machine learning models.

Installation

From PyPI:

$ pip install dm-tree

Directly from github using pip:

$ pip install git+git://github.com/deepmind/tree.git

Build from source:

$ python setup.py install

Support

If you are having issues, please let us know by filing an issue on our issue tracker.

License

The project is licensed under the Apache 2.0 license.

最近版本更新:(数据更新于 2024-10-11 10:09:54)

2022-12-18 17:35:28 0.1.8

2022-04-11 16:44:01 0.1.7

2021-04-12 19:32:09 0.1.6

2021-04-07 22:49:52 0.1.2

2021-04-07 22:49:47 0.1.3

2021-04-07 22:49:14 0.1.4

2021-03-25 04:29:05 0.1.5

2019-11-08 00:10:25 0.1.1

2019-11-06 00:44:57 0.1.0

google-deepmind/tree同语言 Python最近更新仓库

2024-11-05 15:03:24 Cinnamon/kotaemon

2024-11-05 11:00:51 home-assistant/core

2024-11-04 23:11:11 DS4SD/docling

2024-11-04 10:56:18 open-compass/opencompass

2024-11-04 08:51:21 yt-dlp/yt-dlp

2024-11-02 04:45:40 princeton-vl/infinigen