TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Tree – a lib for working with nested data structures, open-sourced by deepmind

127 点作者 okokok___超过 4 年前

5 条评论

thundergolfer超过 4 年前
For those using Bazel this looks like a pretty helpful example of developing and releasing a cross-platform Python package with native-libs (C++ in this case).<p>I&#x27;ve wondered for a while how Deepmind manages their (Python &amp; C++) codebase. This is a small window into that I think, and you can see that they&#x27;re likely using internal &#x27;Blaze&#x27; Python rules and rely on the maintenance of compatibility with the open-source Bazel rules. `py_library` is used in `tree&#x2F;BUILD`, but it is not loaded explicitly as is expected with Bazel these days; the rule definition is loaded by Bazel implicitly.
评论 #25887889 未加载
评论 #25891139 未加载
评论 #25888343 未加载
jimfleming超过 4 年前
From the tree docs:<p>&gt; tree has originally been part of TensorFlow and is available as tf.nest.<p>The tf.nest docs can be found here and may be more useful for now: <a href="https:&#x2F;&#x2F;www.tensorflow.org&#x2F;api_docs&#x2F;python&#x2F;tf&#x2F;nest" rel="nofollow">https:&#x2F;&#x2F;www.tensorflow.org&#x2F;api_docs&#x2F;python&#x2F;tf&#x2F;nest</a><p>I&#x27;m glad this is being moved out of TensorFlow. It&#x27;s a really useful library on its own and I&#x27;ve found myself reaching for it on projects without wanting to import all of TensorFlow.
评论 #25894213 未加载
fulafel超过 4 年前
Caveat emptor: &quot;The behavior for structures with cycle references is undefined&quot;<p>Isn&#x27;t this a pretty common error to occur in Python programs? It would be good to at least have a checked mode available, otherwise the &quot;dragons may fly out of your nose&quot; semantics feels like a pretty aggressive compromise in favour of performance vs correctness.
评论 #25896459 未加载
评论 #25891984 未加载
asimjalis超过 4 年前
Nice. Although I wish the documentation was less sparse.
评论 #25887547 未加载
slightwinder超过 4 年前
So all it&#x27;s doing is flatten the tree?