tenzr::UFunc¶
#include <ufunc.h>
Public Types¶
| Name | |
|---|---|
| using std::function< Tensor(const Tensor &, const Tensor &)> | BinaryFn |
| using std::function< Tensor(const Tensor &)> | UnaryFn |
Public Functions¶
| Name | |
|---|---|
| UFunc(std::string name, UFuncOp op, BinaryFn binary_impl) | |
| UFunc(std::string name, UFuncOp op, UnaryFn unary_impl) | |
| const std::string & | Name() const The ufunc's registered name. |
| UFuncOp | Op() const The built-in op this ufunc maps to. |
| bool | IsBinary() const Whether the ufunc takes two operands. |
| Tensor | operator()(const Tensor & a, const Tensor & b) const |
| Tensor | operator()(const Tensor & a) const |
Detailed Description¶
Named elementwise operation with either a unary or a binary implementation over arrays.
Public Types Documentation¶
using BinaryFn¶
using UnaryFn¶
Public Functions Documentation¶
function UFunc¶
Parameters:
- name Ufunc name.
- op Ufunc kind tag.
- binary_impl Two-argument implementation.
Construct a binary ufunc.
function UFunc¶
Parameters:
- name Ufunc name.
- op Ufunc kind tag.
- unary_impl One-argument implementation.
Construct a unary ufunc.
function Name¶
The ufunc's registered name.
function Op¶
The built-in op this ufunc maps to.
function IsBinary¶
Whether the ufunc takes two operands.