ElementWise

#include <popops/ElementWise.hpp>

These functions perform the same operation on each element of one or more tensors.

Every function has four ways of providing the output:

  • Returning a new output tensor.

  • Writing the output to the first input tensor argument. These functions are suffixed with InPlace and are useful when you don’t need the input tensor after the operation as they don’t create a new live variable for the output.

  • Writing the output to an “out” tensor passed as an argument. These functions are suffixed with WithOutput and are useful for providing your own tile mapping for the output tensor.

  • Performing multiple expressions in one map call.

The functions that perform operations on two tensors support NumPy-style broadcasting of operands, where tensors of different shapes will be broadcast into compatible shapes for the operation. These functions also have overloads where one of the tensors is a constant scalar, which by taking advantage of the broadcasting, performs the same operation on each element in the remaining tensor using the scalar as the other side of the operation for all elements.

See also

Refer to the tutorial on using PopLibs for a full example of how element-wise operations are used.

namespace poputil

General utility functions for building graphs.

Functions

template<>
poplar::ProfileValue toProfileValue(const popops::expr::UnaryOpType &op)
template<>
poplar::ProfileValue toProfileValue(const popops::expr::BinaryOpType &op)
template<>
poplar::ProfileValue toProfileValue(const popops::expr::TernaryOpType &op)
namespace popops

Common functions, such as elementwise and reductions.

map

Map an expression across tensors.

Elementwise Options

  • enableGenerateCodelet (true, false) [=true]

    When true and the following conditions are met, poplar will generate a codelet to execute the map operation. Otherwise, it will sequence poplibs codelets to create the expression.

    • All of the inputs are of the same size

    • Inputs do not alias

    • Multiple operations are being performed

poplar::Tensor map(poplar::Graph &graph, const expr::Expr &expr, const std::vector<poplar::Tensor> &ts, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
Parameters
  • graph – The graph to update.

  • expr – The expression(s) to map across the tensors. The placeholders in the expressions will be substituted with corresponding elements from the tensors in ts.

  • ts – The list of tensors to map the expression across. If elements from these tensors are used in binary/ternary operations in the expression the numpy-style broadcast rules are used to match the shapes of the tensors (see poputil::broadcastToMatch()).

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – A list of flags to pass to the expression evaluator.

Returns

A tensor containing the elements resulting from the application of the expression across the tensors.

inline poplar::Tensor map(poplar::Graph &graph, expr::UnaryOpType op, const poplar::Tensor &t, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
inline poplar::Tensor map(poplar::Graph &graph, expr::BinaryOpType op, const poplar::Tensor &a, const poplar::Tensor &b, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
inline poplar::Tensor map(poplar::Graph &graph, expr::TernaryOpType op, const poplar::Tensor &a, const poplar::Tensor &b, const poplar::Tensor &c, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
std::vector<poplar::Tensor> map(poplar::Graph &graph, const std::vector<expr::Any> &exprs, const std::vector<poplar::Tensor> &ts, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

mapInPlace

Update the input tensors with the result of map().

void mapInPlace(poplar::Graph &graph, const expr::Expr &expr, const std::vector<poplar::Tensor> &ts, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
inline void mapInPlace(poplar::Graph &graph, expr::UnaryOpType op, const poplar::Tensor &t, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
inline void mapInPlace(poplar::Graph &graph, expr::BinaryOpType op, const poplar::Tensor &a, const poplar::Tensor &b, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
inline void mapInPlace(poplar::Graph &graph, expr::TernaryOpType op, const poplar::Tensor &a, const poplar::Tensor &b, const poplar::Tensor &c, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
void mapInPlace(poplar::Graph &graph, const std::vector<expr::Any> &exprs, const std::vector<poplar::Tensor> &ts, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

mapWithOutput

Write the result of map() to the given output tensor.

void mapWithOutput(poplar::Graph &graph, const expr::Expr &expr, const std::vector<poplar::Tensor> &ts, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
inline void mapWithOutput(poplar::Graph &graph, expr::UnaryOpType op, const poplar::Tensor &in, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
inline void mapWithOutput(poplar::Graph &graph, expr::BinaryOpType op, const poplar::Tensor &a, const poplar::Tensor &b, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
inline void mapWithOutput(poplar::Graph &graph, expr::TernaryOpType op, const poplar::Tensor &a, const poplar::Tensor &b, const poplar::Tensor &c, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
void mapWithOutput(poplar::Graph &graph, const std::vector<expr::Any> &exprs, const std::vector<poplar::Tensor> &ts, const std::vector<poplar::Tensor> &outs, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

checkTypes

Check that the host compile-time type constType is compatible with the run-time IPU type elementType.

param elementType

The run-time IPU type.

param constant

Unused.

tparam constType

The host compile-time type.

throws std::runtime_error

If the types are not compatible.

template<typename constType>
inline void checkTypes(poplar::Type elementType, constType)
template<>
inline void checkTypes<float>(poplar::Type elementType, float)
template<>
inline void checkTypes<double>(poplar::Type elementType, double)

varianceToInvStdDev

Convert variance to inverse standard deviation.

Each element in the output tensor is the result of 1 / sqrt(variance_value + epsilon), where variance_value is the corresponding element in variance.

Warning

If variance_value + epsilon is zero then the result will be invalid and this operation could generate a divide-by-zero floating-point exception (if enabled).

param graph

The graph to update.

param variance

A tensor of variance values.

param epsilon

A (typically small) scalar to add to the variance values, to avoid numerical issues (for example, divide by zero).

param prog

The sequence of programs to append this conversion operation to.

param debugContext

Optional debug information.

return

A tensor where each element is the inverse standard deviation.

poplar::Tensor varianceToInvStdDev(poplar::Graph &graph, const poplar::Tensor &src, const poplar::Tensor &epsilon, poplar::program::Sequence &prog, const poplar::Type dstType = poplar::HALF, const poplar::DebugContext &debugContext = {})
poplar::Tensor varianceToInvStdDev(poplar::Graph &graph, const poplar::Tensor &src, const float epsilon, poplar::program::Sequence &prog, const poplar::Type dstType = poplar::HALF, const poplar::DebugContext &debugContext = {})
inline poplar::Tensor varianceToInvStdDev(poplar::Graph &graph, const poplar::Tensor &variance, const poplar::Tensor &epsilon, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor varianceToInvStdDev(poplar::Graph &graph, const poplar::Tensor &variance, const constType epsilon, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor varianceToInvStdDev(poplar::Graph &graph, const constType variance, const poplar::Tensor &epsilon, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

invStdDevToVariance

Convert inverse standard deviation to variance.

Each element in the output tensor is the result of 1 / (invStdDev_value + epsilon)^2, where invStdDev_value is the corresponding element in invStdDev.

Warning

If invStdDev_value + epsilon is zero then the result will be invalid and this operation could generate a divide-by-zero floating-point exception (if enabled).

param graph

The graph to update.

param invStdDev

A tensor of inverse standard deviation values.

param epsilon

A (typically small) scalar to add to the variance values, to avoid numerical issues (for example, divide by zero).

param prog

The sequence of programs to append this conversion operation to.

param debugContext

Optional debug information.

param options

A list of flags to pass to the expression evaluator.

return

A tensor where each element is the variance.

poplar::Tensor invStdDevToVariance(poplar::Graph &graph, const poplar::Tensor &src, const poplar::Tensor &epsilon, poplar::program::Sequence &prog, const poplar::Type dstType = poplar::FLOAT, const poplar::DebugContext &debugContext = {})
poplar::Tensor invStdDevToVariance(poplar::Graph &graph, const poplar::Tensor &src, const float epsilon, poplar::program::Sequence &prog, const poplar::Type dstType = poplar::FLOAT, const poplar::DebugContext &debugContext = {})
inline poplar::Tensor invStdDevToVariance(poplar::Graph &graph, const poplar::Tensor &invStdDev, const poplar::Tensor &epsilon, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor invStdDevToVariance(poplar::Graph &graph, const poplar::Tensor &invStdDev, const constType epsilon, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor invStdDevToVariance(poplar::Graph &graph, const constType invStdDev, const poplar::Tensor &epsilon, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

add

Add each element in A to the corresponding element in B.

param graph

The graph to update.

param A

A tensor of elements.

param B

A tensor of elements.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information

param options

Element-wise options. See map().

return

A tensor where each element is the result of a + b, where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor add(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor add(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor add(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

addInPlace

Update the tensor A with the result of add().

See add() for parameter descriptions.

inline void addInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void addInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

addWithOutput

Write the result of add() to the given output tensor, out.

See add() for the remaining parameter descriptions.

param out

The tensor to write the results to.

inline void addWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void addWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void addWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

sub

Subtract the elements of B from A and return the result in a new tensor.

param graph

The graph to update.

param A

The tensor of elements which will be subtracted from.

param B

The tensor of elements to subtract from A.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information.

param options

Element-wise options. See map().

return

A tensor where each element is equal to a - b, where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor sub(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor sub(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor sub(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

subInPlace

Update the tensor A with the result of sub().

See sub() for parameter descriptions.

inline void subInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void subInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

subWithOutput

Write the result of sub() to the given output tensor, out.

See sub() for the remaining parameter descriptions.

param out

The tensor to write the results to.

inline void subWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void subWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void subWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

mul

Multiply each element in A by the corresponding element in B.

param graph

The graph to update.

param A

A tensor of elements.

param B

A tensor of elements.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information.

param options

Element-wise options. See map().

return

A tensor where each element is the result of a * b, where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor mul(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor mul(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor mul(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

mulInPlace

Update the tensor A with the result of mul().

See mul() for parameter descriptions.

inline void mulInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void mulInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

mulWithOutput

Write the result of mul() to the given output tensor, out.

See mul() for the remaining parameter descriptions.

param out

The tensor to write the results to.

inline void mulWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void mulWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void mulWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

div

Divide each element in A by the corresponding element in B.

param graph

The graph to update.

param A

The tensor of dividends.

param B

The tensor of divisors.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information

param options

Element-wise options. See map().

return

A tensor where each element is the result of a / b, where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor div(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor div(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor div(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

divInPlace

Update the tensor A with the result of div().

See div() for parameter descriptions.

inline void divInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void divInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

divWithOutput

Write the result of div() to the given output tensor, out.

See div() for the remaining parameter descriptions.

param out

The tensor to write the results to.

inline void divWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void divWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void divWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

pow

Compute each element in A to the power of the corresponding element in B.

param graph

The graph to update.

param A

The tensor of bases.

param B

The tensor of exponents.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information.

param options

Element-wise options. See map().

return

A tensor where each element is equal to pow(a, b), where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor pow(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor pow(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor pow(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

powInPlace

Update the tensor A with the result of pow().

See pow() for parameter descriptions.

inline void powInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void powInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

powWithOutput

Write the result of pow() to the given output tensor, out.

See pow() for the remaining parameter descriptions.

param out

The tensor to write the results to.

inline void powWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void powWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void powWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

rem

Compute the remainder of each element in A divided by the corresponding element in B.

param graph

The graph to update.

param A

The tensor of dividends.

param B

The tensor of divisors.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information.

param options

Element-wise options. See map().

return

A tensor where each element is equal to a % b, where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor rem(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor rem(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor rem(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

remInPlace

Update the tensor A with the result of rem().

See rem() for parameter descriptions.

inline void remInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void remInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

remWithOutput

Write the result of rem() to the given output tensor, out.

See rem() for the remaining parameter descriptions.

param out

The tensor to write the results to.

inline void remWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void remWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void remWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

bitwiseAnd

Compute the bitwise AND of each element in A with the corresponding element in B.

param graph

The graph to update.

param A

A tensor of elements.

param B

A tensor of elements.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information

param options

Element-wise options. See map().

return

A tensor where each element is the result of a & b, where a and bare the corresponding elements of A and B tensors respectively.

inline poplar::Tensor bitwiseAnd(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor bitwiseAnd(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor bitwiseAnd(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

bitwiseAndInPlace

Update the tensor A with the result of bitwiseAnd().

See bitwiseAnd() for parameter descriptions.

inline void bitwiseAndInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void bitwiseAndInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

bitwiseAndWithOutput

Write the result of bitwiseAnd() to the given output tensor, out.

See bitwiseAnd() for the remaining parameter descriptions.

param out

The tensor to write the results to.

inline void bitwiseAndWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void bitwiseAndWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void bitwiseAndWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

bitwiseOr

Compute the bitwise OR of each element in A with the corresponding element in B.

param graph

The graph to update.

param A

A tensor of elements.

param B

A tensor of elements.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information

param options

Element-wise options. See map().

return

A tensor where each element is the result of a | b, where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor bitwiseOr(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor bitwiseOr(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor bitwiseOr(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

bitwiseOrInPlace

Update the tensor A with the result of bitwiseOr().

See bitwiseOr() for parameter descriptions.

inline void bitwiseOrInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void bitwiseOrInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

bitwiseOrWithOutput

Write the result of bitwiseOr() to the given output tensor, out.

See bitwiseOr() for the remaining parameter descriptions.

param out

The tensor to write the results to.

inline void bitwiseOrWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void bitwiseOrWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void bitwiseOrWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

bitwiseXor

Compute the bitwise XOR of each element in A with the corresponding element in B.

param graph

The graph to update.

param A

A tensor of elements.

param B

A tensor of elements.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information

param options

Element-wise options. See map().

return

A tensor where each element is the result of a ^ b, where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor bitwiseXor(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor bitwiseXor(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor bitwiseXor(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

bitwiseXorInPlace

Update the tensor A with the result of bitwiseXor().

See bitwiseXnor() for parameter descriptions.

inline void bitwiseXorInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void bitwiseXorInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

bitwiseXorWithOutput

Write the result of bitwiseXor() to the given output tensor, out.

See bitwiseXor() for the remaining parameter descriptions.

param out

The tensor to write the results to.

inline void bitwiseXorWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void bitwiseXorWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void bitwiseXorWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

bitwiseXnor

Compute the bitwise XNOR of each element in A with the corresponding element in B.

param graph

The graph to update.

param A

A tensor of elements.

param B

A tensor of elements.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information

param options

Element-wise options. See map().

return

A tensor where each element is the result of !(a ^ b), where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor bitwiseXnor(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor bitwiseXnor(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor bitwiseXnor(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

bitwiseXnorInPlace

Update the tensor A with the result of bitwiseXnor().

See bitwiseXnor() for parameter descriptions.

inline void bitwiseXnorInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void bitwiseXnorInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

bitwiseXnorWithOutput

Write the result of bitwiseXnor() to the given output tensor, out.

See bitwiseXnor() for the remaining parameter descriptions.

param out

The tensor to write the results to.

inline void bitwiseXnorWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void bitwiseXnorWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void bitwiseXnorWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

shiftLeft

Shift the elements of A left by the corresponding elements of B.

param graph

The graph to update.

param A

The tensor of elements which to left-shift.

param B

The tensor of elements that describe the amount to left-shift A by.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information.

param options

Element-wise options. See map().

return

A tensor where each element is equal to a << b, where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor shiftLeft(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor shiftLeft(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor shiftLeft(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

shiftLeftInPlace

Update the tensor A with the result of shiftLeft().

See shiftLeft() for parameter descriptions.

inline void shiftLeftInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void shiftLeftInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

shiftLeftWithOutput

Write the result of shiftLeft() to the given output tensor, out.

See shiftLeft() for the remaining parameter descriptions.

param out

The tensor to write the results to.

inline void shiftLeftWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void shiftLeftWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void shiftLeftWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

shiftRight

Shift the elements of A right by the corresponding elements of B.

param graph

The graph to update.

param A

The tensor of elements which to right-shift.

param B

The tensor of elements that describe the amount to right-shift by. A.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information.

param options

Element-wise options. See map().

return

A tensor where each element is equal to a >> b (without sign extension), where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor shiftRight(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor shiftRight(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor shiftRight(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

shiftRightInPlace

Update the tensor A with the result of shiftRight().

See shiftRight() for parameter descriptions.

inline void shiftRightInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void shiftRightInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

shiftRightWithOutput

Write the result of shiftRight() to the given output tensor, out.

See shiftRight() for the remaining parameter descriptions.

param out

The tensor to write the results to.

inline void shiftRightWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void shiftRightWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void shiftRightWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

shiftRightSignExtend

Shift the elements of A right with sign extension by the corresponding elements of B.

param graph

The graph to update.

param A

The tensor of elements which to right-shift.

param B

The tensor of elements that describe the amount to right-shift A by.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information.

param options

Element-wise options. See map().

return

A tensor where each element is equal to a >> b with sign extension, where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor shiftRightSignExtend(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor shiftRightSignExtend(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor shiftRightSignExtend(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

shiftRightSignExtendInPlace

Update the tensor A with the result of shiftRightSignExtend().

See shiftRightSignExtend() for parameter descriptions.

inline void shiftRightSignExtendInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void shiftRightSignExtendInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

shiftRightSignExtendWithOutput

Write the result of shiftRightSignExtend() to the given output tensor, out.

See shiftRightSignExtend() for the remaining parameter descriptions.

param out

The tensor to write the results to.

inline void shiftRightSignExtendWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void shiftRightSignExtendWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void shiftRightSignExtendWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

logicalAnd

Compute the logical AND (&&) of each element in A with the corresponding element in B.

param graph

The graph to update.

param A

A tensor of elements.

param B

A tensor of elements.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information.

param options

Element-wise options. See map().

return

A tensor where each element is the result of a && b, where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor logicalAnd(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor logicalAnd(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor logicalAnd(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

logicalAndInPlace

Update the tensor A with the result of logicalAnd().

See logicalAnd() for parameter descriptions.

inline void logicalAndInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void logicalAndInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

logicalAndWithOutput

Write the result of logicalAnd() to the given output tensor, out.

See logicalAnd() for the remaining parameter descriptions.

param out

The tensor to write the booleans to.

inline void logicalAndWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void logicalAndWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void logicalAndWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

logicalOr

Compute the logical OR (||) of each element in A with the corresponding element in B.

param graph

The graph to update.

param A

A tensor of elements.

param B

A tensor of elements.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information.

param options

Element-wise options. See map().

return

A tensor where each element is the result of a || b, where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor logicalOr(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor logicalOr(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor logicalOr(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

logicalOrInPlace

Update the tensor A with the result of logicalOr().

See logicalOr() for parameter descriptions.

inline void logicalOrInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void logicalOrInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

logicalOrWithOutput

Write the result of logicalOr() to the given output tensor, out.

See logicalOr() for the remaining parameter descriptions.

param out

The tensor to write the booleans to.

inline void logicalOrWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void logicalOrWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void logicalOrWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

eq

Check if each element in A is equal to the corresponding element in B.

param graph

The graph to update.

param A

A tensor of elements.

param B

A tensor of elements.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information

param options

Element-wise options. See map().

return

A tensor where each element is the result of a == b, where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor eq(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor eq(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor eq(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

eqInPlace

Update the tensor A with the result of eq().

See eq() for parameter descriptions.

inline void eqInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void eqInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

eqWithOutput

Write the result of eq() to the given output tensor, out.

See eq() for the remaining parameter descriptions.

param out

The tensor to write the booleans to.

inline void eqWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void eqWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void eqWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

neq

Check if each element in A is not equal to the corresponding element in B.

param graph

The graph to update.

param A

A tensor of elements.

param B

A tensor of elements.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information.

param options

Element-wise options. See map().

return

A tensor where each element is the result of a != b, where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor neq(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor neq(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor neq(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

neqInPlace

Update the tensor A with the result of neq().

See neq() for parameter descriptions.

inline void neqInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void neqInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

neqWithOutput

Write the result of neq() to the given output tensor, out.

See neq() for the remaining parameter descriptions.

param out

The tensor to write the booleans to.

inline void neqWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void neqWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void neqWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

gteq

Check if each element in A is greater than or equal to the corresponding element in B.

param graph

The graph to update.

param A

A tensor of elements.

param B

A tensor of elements.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information

param options

Element-wise options. See map().

return

A tensor where each element is the result of a >= b, where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor gteq(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor gteq(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor gteq(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

gteqInPlace

Update the tensor A with the result of gteq().

See gteq() for parameter descriptions.

inline void gteqInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void gteqInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

gteqWithOutput

Write the result of gteq() to the given output tensor, out.

See gteq() for the remaining parameter descriptions.

param out

The tensor to write the booleans to.

inline void gteqWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void gteqWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void gteqWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

gt

Check if each element in A is greater than the corresponding element in B.

param graph

The graph to update.

param A

A tensor of elements.

param B

A tensor of elements.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information

param options

Element-wise options. See map().

return

A tensor where each element is the result of a > b, where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor gt(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor gt(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor gt(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

gtInPlace

Update the tensor A with the result of gt().

See gt() for parameter descriptions.

inline void gtInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void gtInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

gtWithOutput

Write the result of gt() to the given output tensor, out.

See gt() for the remaining parameter descriptions.

param out

The tensor to write the booleans to.

inline void gtWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void gtWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void gtWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

lteq

Check if each element in A is less than or equal to the corresponding element in B.

param graph

The graph to update.

param A

A tensor of elements.

param B

A tensor of elements.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information.

param options

Element-wise options. See map().

return

A tensor where each element is the result of a <= b, where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor lteq(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor lteq(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor lteq(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

lteqInPlace

Update the A with the result of lteq().

See lteq() for parameter descriptions.

inline void lteqInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void lteqInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

lteqWithOutput

Write the result of lteq() to the given output tensor, out.

See lteq() for the remaining parameter descriptions.

param out

The tensor to write the booleans to.

inline void lteqWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void lteqWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void lteqWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

lt

Check if each element in A is less than the corresponding element in B.

param graph

The graph to update.

param A

A tensor of elements.

param B

A tensor of elements.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information.

param options

Element-wise options. See map().

return

A tensor where each element is the result of a < b, where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor lt(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor lt(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor lt(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

ltInPlace

Update the A with the result of lt().

See lt() for parameter descriptions.

inline void ltInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void ltInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

ltWithOutput

Write the result of lt() to the given output tensor, out.

See lt() for the remaining parameter descriptions.

param out

The tensor to write the boolean results to.

inline void ltWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void ltWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void ltWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

max

Compute the maximum of each element in A with the corresponding element in B.

param graph

The graph to update.

param A

A tensor of elements.

param B

A tensor of elements.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information.

param options

Element-wise options. See map().

return

A tensor where each element is the result of max(a, b), where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor max(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor max(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor max(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

maxInPlace

Update the tensor A with the result of max().

See max() for parameter descriptions.

inline void maxInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void maxInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

maxWithOutput

Write the result of max() to the given output tensor, out.

See max() for the remaining parameter descriptions.

param out

The tensor to write the maximums to.

inline void maxWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void maxWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void maxWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

min

Compute the minimum of each element in A with the corresponding element in B.

param graph

The graph to update.

param A

A tensor of elements.

param B

A tensor of elements.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information.

param options

Element-wise options. See map().

return

A tensor where each element is the result of min(a, b), where a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor min(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor min(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor min(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

minInPlace

Update the tensor A with the result of min().

See min() for parameter descriptions.

inline void minInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void minInPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

minWithOutput

Write the result of min() to the given output tensor, out.

See min() for the remaining parameter descriptions.

param out

The tensor to write the minimums to.

inline void minWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void minWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void minWithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

atan2

Compute the element-wise arctangent of A / B.

param graph

The graph to update.

param A

A tensor of elements.

param B

A tensor of elements.

param prog

The sequence to extend with the execution of the expression evaluation.

param debugContext

Optional debug information

param options

Element-wise options. See map().

return

A tensor where each element is the result of arctan(a / b); a and b are the corresponding elements of A and B tensors respectively.

inline poplar::Tensor atan2(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor atan2(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline poplar::Tensor atan2(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

atan2InPlace

Update the tensor A with the result of atan2().

See atan2() for parameter descriptions.

inline void atan2InPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void atan2InPlace(poplar::Graph &graph, const poplar::Tensor &A, const constType B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

atan2WithOutput

Write the result of atan2() to the given output tensor, out.

See atan2() for the remaining parameter descriptions.

param out

The tensor to write the result to.

inline void atan2WithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void atan2WithOutput(poplar::Graph &graph, const poplar::Tensor &A, const constType B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void atan2WithOutput(poplar::Graph &graph, const constType A, const poplar::Tensor &B, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

invStdDevToVarianceInPlace

Update the invStdDev tensor with the result of invStdDevToVariance().

See invStdDevToVariance() for parameter descriptions.

inline void invStdDevToVarianceInPlace(poplar::Graph &graph, const poplar::Tensor &invStdDev, const poplar::Tensor &epsilon, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void invStdDevToVarianceInPlace(poplar::Graph &graph, const poplar::Tensor &invStdDev, const constType epsilon, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

invStdDevToVarianceWithOutput

Write the result of invStdDevToVariance() to the given output tensor, out.

See invStdDevToVariance() for the remaining parameter descriptions.

param out

The tensor to write the variance to.

inline void invStdDevToVarianceWithOutput(poplar::Graph &graph, const poplar::Tensor &invStdDev, const poplar::Tensor &epsilon, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void invStdDevToVarianceWithOutput(poplar::Graph &graph, const poplar::Tensor &invStdDev, const constType epsilon, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void invStdDevToVarianceWithOutput(poplar::Graph &graph, const constType invStdDev, const poplar::Tensor &epsilon, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

varianceToInvStdDevInPlace

Update the variance tensor with the result of varianceToInvStdDev().

See varianceToInvStdDev() for parameter descriptions.

inline void varianceToInvStdDevInPlace(poplar::Graph &graph, const poplar::Tensor &variance, const poplar::Tensor &epsilon, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void varianceToInvStdDevInPlace(poplar::Graph &graph, const poplar::Tensor &variance, const constType epsilon, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

varianceToInvStdDevWithOutput

Write the result of varianceToInvStdDev() to the given output tensor, out.

See varianceToInvStdDev() for the remaining parameter descriptions.

param out

The tensor to write inverse standard deviation to.

inline void varianceToInvStdDevWithOutput(poplar::Graph &graph, const poplar::Tensor &variance, const poplar::Tensor &epsilon, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void varianceToInvStdDevWithOutput(poplar::Graph &graph, const poplar::Tensor &variance, const constType epsilon, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})
template<typename constType>
inline void varianceToInvStdDevWithOutput(poplar::Graph &graph, const constType variance, const poplar::Tensor &epsilon, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Functions

void outputGeneratedCodelet(const poplar::Target &target, const expr::Expr &expr, const std::vector<poplar::Tensor> &ts, const poplar::OptionFlags &options, std::ostream &os)

Writes the generated codelet for the given expr and ts to os.

Parameters
  • target – The target the graph is being constructed to work with.

  • expr – The expression to map across the tensors. The placeholders in the expressions will be substituted with corresponding elements from the tensors in ts.

  • ts – The list of tensors to map the expression across. If elements from these tensors are used in binary/ternary operations in the expression the numpy-style broadcast rules are used to match the shapes of the tensors (see poputil::broadcastToMatch()).

  • options – A list of flags to pass to the expression evaluator. See map() function for details.

  • os – The stream to output generated codelet.

inline poplar::Tensor abs(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the absolute value of each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of std::abs(a), where a is an element of A.

inline void absInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of abs().

inline void absWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of abs() to the given output tensor.

inline poplar::Tensor inv(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the inverse of each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of 1 / a, where a is an element of A.

inline void invInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of inv().

inline void invWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of inv() to the given output tensor.

inline poplar::Tensor logicalNot(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the logical NOT of each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of !a, where a is an element of A.

inline void logicalNotInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of logicalNot().

inline void logicalNotWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of logicalNot() to the given output tensor.

inline poplar::Tensor neg(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the negation of each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of -1 * a, where a is an element of A.

inline void negInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of neg().

inline void negWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of neg() to the given output tensor.

inline poplar::Tensor signum(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the signum of each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is one of -1, 0 or +1 if the corresponding element in A was less than, equal to or greater than 0 respectively.

inline void signumInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of signum().

inline void signumWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of signum() to the given output tensor.

inline poplar::Tensor isFinite(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Check if each element in A is finite.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of std::isfinite(a), where a is an element of A.

inline void isFiniteWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of isFinite() to the given output tensor.

inline poplar::Tensor bitwiseNot(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the bitwise NOT operation for each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of ~a, where a is an element of A.

inline void bitwiseNotInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of bitwiseNot().

inline void bitwiseNotWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of bitwiseNot() to the given output tensor.

inline poplar::Tensor countLeadingZeros(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the number of binary leading zeros of each element in A.

Note

If the element is zero then it is treated as 32 leading zeros.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of a ? __builtin_clz(a) : 32, where a is an element of A.

inline void countLeadingZerosInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of countLeadingZeros().

inline void countLeadingZerosWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of countLeadingZeros() to the given output tensor.

inline poplar::Tensor popcount(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the number of 1 bits in each element of A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of std::popcount(a), where a is an element of A.

inline void popcountInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of popcount().

inline void popcountWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of popcount() to the given output tensor.

inline poplar::Tensor ceil(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the ceiling of each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of std::ceil(a), where a is an element of A.

inline void ceilInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of ceil().

inline void ceilWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of ceil() to the given output tensor.

inline poplar::Tensor floor(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the floor of each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of std::floor(a), where a is an element of A.

inline void floorInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of floor().

inline void floorWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of floor() to the given output tensor.

inline poplar::Tensor round(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Round each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of std::round(a), where a is an element of A.

inline void roundInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of round().

inline void roundWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of round() to the given output tensor.

inline poplar::Tensor cbrt(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the cube-root for each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of std::cbrt(a), where a is an element of A.

inline void cbrtInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of cbrt().

inline void cbrtWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of cbrt() to the given output tensor.

inline poplar::Tensor exp(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the exponential of each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of std::exp(a), where a is an element of A.

inline void expInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of exp().

inline void expWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of exp() to the given output tensor.

inline poplar::Tensor exp2(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the power of 2 for each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of std::exp2(a), where a is an element of A.

inline void exp2InPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of exp2().

inline void exp2WithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of exp2() to the given output tensor.

inline poplar::Tensor expm1(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the exponential of each element in A minus one.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of std::expm1(a), where a is an element of A.

inline void expm1InPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of expm1().

inline void expm1WithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of expm1() to the given output tensor.

inline poplar::Tensor log(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the log base-e of each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of std::log(a), where a is an element of A.

inline void logInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of log().

inline void logWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of log() to the given output tensor.

inline poplar::Tensor log1p(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the log base-e of each element in A plus one.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of std::log1p(a), where a is an element of A.

inline void log1pInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of log1p().

inline void log1pWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of log1p() to the given output tensor.

inline poplar::Tensor sqrt(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the square-root for each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of std::sqrt(a), where a is an element of A.

inline void sqrtInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of sqrt().

inline void sqrtWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of sqrt() to the given output tensor.

inline poplar::Tensor square(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the square for each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of x * x, where a is an element of A.

inline void squareInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of square().

inline void squareWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of square() to the given output tensor.

inline poplar::Tensor rsqrt(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the reciprocal square root for each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of 1 / sqrt(a), where a is an element of A.

inline void rsqrtInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of rsqrt().

inline void rsqrtWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of rsqrt() to the given output tensor.

inline poplar::Tensor sigmoid(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the sigmoid (logistic) function for each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of 1 / (1 + exp(-x)), where a is an element of A.

inline void sigmoidInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of sigmoid().

inline void sigmoidWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of sigmoid() to the given output tensor.

inline poplar::Tensor asin(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the arc-sine of each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of std::asin(a), where a is an element of A.

inline void asinInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of asin().

inline void asinWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of asin() to the given output tensor.

inline poplar::Tensor cos(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the cosine of each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of std::cos(a), where a is an element of A.

inline void cosInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of cos().

inline void cosWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of cos() to the given output tensor.

inline poplar::Tensor sin(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the sine of each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of std::sin(a), where a is an element of A.

inline void sinInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of sin().

inline void sinWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of sin() to the given output tensor.

inline poplar::Tensor tan(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the tangent of each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of std::tan(a), where a is an element of A.

inline void tanInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of tan().

inline void tanWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of tan() to the given output tensor.

inline poplar::Tensor tanh(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the hyperbolic tangent of each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of std::tanh(a), where a is an element of A.

inline void tanhInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of tanh().

inline void tanhWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of tanh() to the given output tensor.

inline poplar::Tensor geluErf(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute (1 + erf(A/sqrt(2))) * A / 2 where all the operations are element-wise, and erf is the error function.

This is a very accurate implementation with low relative and absolute error.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of geluErf(a), where a is an element of A.

inline void geluErfInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of geluErf().

inline void geluErfWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of geluErf() to the given output tensor.

inline poplar::Tensor erf(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Compute the error function of each element in A.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information

  • options – Element-wise options. See map().

Returns

A tensor where each element is equivalent to the result of std::erf(a), where a is an element of A.

inline void erfInPlace(poplar::Graph &graph, const poplar::Tensor &A, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the input tensor with the result of erf().

inline void erfWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of erf() to the given output tensor.

inline poplar::Tensor select(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &conditions, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Select elements from one of two tensors depending on a tensor of conditions.

For each element in the output compute condition ? a : b, where condition, a and b are the corresponding elements in the tensors conditions, A and B respectively.

Parameters
  • graph – The graph to update.

  • A – The first tensor containing the elements to select from.

  • B – The second tensor containing the elements to select from.

  • conditions – The tensor containing the elements to use as conditions. When the element is true-like (non-zero) take an element from A and when false-like (zero) take an element from B.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information.

  • options – Element-wise options. See map().

Returns

A tensor containing the elements from A where the corresponding elements in conditions were non-zero and containing the elements from B where the corresponding elements in conditions were zero.

inline void selectInPlace(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &conditions, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the A input tensor with the result of select().

See select() for parameter descriptions.

inline void selectWithOutput(poplar::Graph &graph, const poplar::Tensor &A, const poplar::Tensor &B, const poplar::Tensor &conditions, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of select() to the given output tensor, out.

See select() for the remaining parameter descriptions.

Parameters

out – The tensor to write the selected values to.

inline poplar::Tensor clamp(poplar::Graph &graph, const poplar::Tensor &values, const poplar::Tensor &minimums, const poplar::Tensor &maximums, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Clamp all the elements in values between minimums and maximums.

Populate the returned tensor with elements from values but clamp them such that each element is greater than or equal to the corresponding element in minimums and less than or equal to the corresponding element in maximums.

That is, for each element in the returned tensor compute: min(max(value, min_value), max_value), where value, min_value and max_value are the corresponding elements in the tensors values, minimums and maximums respectively.

Parameters
  • graph – The graph to update.

  • values – The tensor containing the elements to clamp.

  • minimums – The tensor containing the elements to use as minimums.

  • maximums – The tensor containing the elements to use as maximums.

  • prog – The sequence to extend with the execution of the expression evaluation.

  • debugContext – Optional debug information.

  • options – Element-wise options. See map().

Returns

A tensor containing the clamped elements of values.

inline void clampInPlace(poplar::Graph &graph, const poplar::Tensor &values, const poplar::Tensor &minimums, const poplar::Tensor &maximums, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Update the values input tensor with the result of clamp().

See clamp() for parameter descriptions.

inline void clampWithOutput(poplar::Graph &graph, const poplar::Tensor &values, const poplar::Tensor &minimums, const poplar::Tensor &maximums, const poplar::Tensor &out, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Write the result of clamp() to the given output tensor, out.

See clamp() for the remaining parameter descriptions.

Parameters

out – The tensor to write the clamped values to.