TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

127 pointsby okokok___over 4 years ago

5 comments

thundergolferover 4 years ago
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 未加载
jimflemingover 4 years ago
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 未加载
fulafelover 4 years ago
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 未加载
asimjalisover 4 years ago
Nice. Although I wish the documentation was less sparse.
评论 #25887547 未加载
slightwinderover 4 years ago
So all it&#x27;s doing is flatten the tree?