#include <PermuteAsReshape.hpp>
Definition at line 14 of file PermuteAsReshape.hpp.
◆ PermuteAsReshapeImpl()
◆ ~PermuteAsReshapeImpl()
◆ Run()
Run for every PermuteLayer. Replaces it with a ReshapeLayer if they are equivalent.
Definition at line 18 of file PermuteAsReshape.hpp.
References Layer::GetInputSlot(), Layer::GetName(), Layer::GetOutputHandler(), Layer::GetOutputSlot(), PermuteLayer::GetPermutation(), TensorInfo::GetShape(), PermutationVector::GetSize(), OutputHandler::GetTensorInfo(), Graph::InsertNewLayer(), OutputSlot::MoveAllConnections(), PermuteAsReshapeImpl::PermuteAsReshapeImpl(), OutputHandler::SetTensorInfo(), and PermuteAsReshapeImpl::~PermuteAsReshapeImpl().
20 if (IsReshape(permute))
22 const TensorInfo& outInfo = permute.GetOutputHandler().GetTensorInfo();
24 const std::string name = std::string(
"as_reshape-") + permute.GetName();
25 const ReshapeDescriptor descriptor{outInfo.GetShape()};
27 auto reshape = graph.InsertNewLayer<ReshapeLayer>(permute.GetInputSlot(0), descriptor, name.c_str());
28 reshape->GetOutputHandler().SetTensorInfo(outInfo);
31 permute.GetOutputSlot().MoveAllConnections(reshape->GetOutputSlot());
The documentation for this class was generated from the following file: