Poplar and PopLibs
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Broadcast.hpp
Go to the documentation of this file.
1// Copyright (c) 2018 Graphcore Ltd. All rights reserved.
8#ifndef poputil_Broadcast_hpp
9#define poputil_Broadcast_hpp
10#include <poplar/Tensor.hpp>
11
12namespace poputil {
13
24
43void broadcastToMatch(poplar::Tensor &a, const std::vector<std::size_t> &shape);
44
66
90
102
103} // namespace poputil
104
105#endif // poputil_Broadcast_hpp
A reference to a subset of tensor elements.
Definition: Tensor.hpp:38
General utility functions for building graphs.
Definition: GfloatExprUtil.hpp:23
bool canBroadcastToMatch(const poplar::Tensor &a, const poplar::Tensor &b)
Test if the given tensors can be broadcast to match one another using the rules for broadcastToMatch(...
void expandToMatchRanks(poplar::Tensor &a, poplar::Tensor &b)
Match dimensions of two tensors using numpy-style expansion rules.
void broadcastToMatch(poplar::Tensor &a, const std::vector< std::size_t > &shape)
Match dimensions of a tensor to a shape using numpy-style broadcast rules: