Skip to content

Instantly share code, notes, and snippets.

@neocxi
Created November 18, 2015 00:33
Show Gist options
  • Select an option

  • Save neocxi/9407e6639f47724e5893 to your computer and use it in GitHub Desktop.

Select an option

Save neocxi/9407e6639f47724e5893 to your computer and use it in GitHub Desktop.
def fuse(fn):
impl = select_impl()
out = impl.get(fn.__name__)
out.__doc__ = "%s\nImpl specifics: %s" % (fn.__doc__, out.__doc__)
return out
# in common api
@fuse
def prod(x, axis=None):
"""Product of tensor"""
pass
# in cgt module
def prod(x):
"""axis argument is not supported"""
return bla
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment