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