ElementWise

#include <popops/ElementWise.hpp>

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

Every function has an in-place overload that writes the result of the function to the first tensor argument of the function.

The functions that perform operations on two tensors also have overloads for one of the tensors being a constant scalar. These functions perform the same operation on each element in the remaining tensor using the scalar as the other side of the operation for all elements.

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.

Unnamed Group

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 = {})

Convert variance to inverse standard deviation.

Parameters
  • graph – The graph to update.

  • src – The source tensor.

  • epsilon – A tensor initialised with the epsilon parameter used in conversion. Must have a single element and have the same type as the input type. Alternatively a float value can be used and the appropriate tensor will be created.

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

  • dstType – The type of the tensor to be output. Must be HALF or equal to the input type.

  • debugContext – Optional debug information

Returns

A tensor where each element is the inverse of standard deviation. Each element is the result of b = sqrt(1 / a), where a and b are the corresponding elements of src and the result tensor respectively.

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 = {})

Unnamed Group

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 = {})

Convert inverse standard deviation to variance.

Parameters
  • graph – The graph to update.

  • src – The source tensor.

  • epsilon – A tensor initialised with the epsilon parameter used in conversion. Must have a single element and have the same type as the input type. Alternatively, a float value can be used and the appropriate tensor will be created.

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

  • dstType – The type of the tensor to be output. Must be FLOAT or equal to the input type.

  • debugContext – Optional debug information

Returns

A tensor where each element is the variance. Each element is the result of b = (1 / a) ^ 2, where a and b are the corresponding elements of src and the result tensor respectively.

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 = {})

Unnamed Group

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 = {})

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

Parameters
  • graph – The graph to update.

  • 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()).

  • 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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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.

Unnamed Group

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

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

Parameters
  • elementType – The run-time IPU type.

  • constant – Unused.

Template Parameters

constType – The host compile-time type.

Throws

std::runtime_error – If the types are not compatible.

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

Unnamed Group

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 = {})

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

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • B – 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 the result of a + b, where a and b are the corresponding elements of A and B tensors respectively.

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

Compute the two argument arctangent of each element in A with the corresponding element in B.

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • B – 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 the result of atan2(a, b), where a and b are the corresponding elements of A and B tensors respectively.

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • B – 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 the result of a & b, where a and bare the corresponding elements of A and B tensors respectively.

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • B – 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 the result of a | b, where a and b are the corresponding elements of A and B tensors respectively.

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • B – 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 the result of a ^ b, where a and b are the corresponding elements of A and B tensors respectively.

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • B – 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 the result of !(a ^ b), where a and b are the corresponding elements of A and B tensors respectively.

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

Parameters
  • graph – The graph to update.

  • A – The tensor of dividends.

  • B – The tensor of divisors.

  • 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 the result of a / b, where a and b are the corresponding elements of A and B tensors respectively.

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • B – 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 the result of a == b, where a and b are the corresponding elements of A and B tensors respectively.

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • B – 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 the result of a >= b, where a and b are the corresponding elements of A and B tensors respectively.

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • B – 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 the result of a > b, where a and b are the corresponding elements of A and B tensors respectively.

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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

Convert the inverse standard deviation to variance.

Parameters
  • graph – The graph to update.

  • A – The source tensor.

  • B – The destination tensor.

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

  • debugContext – Optional debug information.

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

Returns

A tensor where each element is the variance. Each element is the result of b = (1 / a) ^ 2, where a and b are the corresponding elements of A and B tensors respectively, and where A represents the inverse standard deviation and B the variance.

template<typename constType>
inline poplar::Tensor invStdDevToVariance(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 invStdDevToVariance(poplar::Graph &graph, const constType A, const poplar::Tensor &B, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext = {}, const poplar::OptionFlags &options = {})

Unnamed Group

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

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

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

Unnamed Group

inline void invStdDevToVarianceWithOutput(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 = {})

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

template<typename constType>
inline void invStdDevToVarianceWithOutput(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 invStdDevToVarianceWithOutput(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 = {})

Unnamed Group

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 = {})

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

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • B – 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 the result of a <= b, where a and b are the corresponding elements of A and B tensors respectively.

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • B – 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 the result of a && b, where a and b are the corresponding elements of A and B tensors respectively.

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • B – 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 the result of a || b, where a and b are the corresponding elements of A and B tensors respectively.

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • B – 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 the result of a < b, where a and b are the corresponding elements of A and B tensors respectively.

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • B – 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 the result of max(a, b), where a and b are the corresponding elements of A and B tensors respectively.

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • B – 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 the result of min(a, b), where a and b are the corresponding elements of A and B tensors respectively.

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {})

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

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 minWithOutoput(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 = {})

Unnamed Group

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 = {})

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

Parameters
  • graph – The graph to update.

  • A – A tensor of elements.

  • B – 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 the result of a * b, where a and b are the corresponding elements of A and B tensors respectively.

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 = {})

Unnamed Group

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 = {})

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

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 = {})

Unnamed Group

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 = {},