Compute Library
 21.08
SyntheticDataTypeMutator Class Referencefinal

Mutation pass to create synthetic graphs of a given data type. More...

#include <SyntheticDataTypeMutator.h>

Collaboration diagram for SyntheticDataTypeMutator:
[legend]

Public Member Functions

 SyntheticDataTypeMutator (DataType mutate_type=DataType::QASYMM8)
 
virtual void mutate (Graph &g) override
 Walk the graph and perform a specific mutation. More...
 
MutationType type () const override
 Returns mutation type. More...
 
const char * name () override
 Returns mutator name. More...
 
- Public Member Functions inherited from IGraphMutator
virtual ~IGraphMutator ()=default
 Virtual Destructor. More...
 

Additional Inherited Members

- Public Types inherited from IGraphMutator
enum  MutationType { IR, Backend }
 Mutation type. More...
 

Detailed Description

Mutation pass to create synthetic graphs of a given data type.

Definition at line 35 of file SyntheticDataTypeMutator.h.

Constructor & Destructor Documentation

◆ SyntheticDataTypeMutator()

Definition at line 269 of file SyntheticDataTypeMutator.cpp.

270  : _mutate_type{ mutate_type }
271 {
272 }

Member Function Documentation

◆ mutate()

void mutate ( Graph g)
overridevirtual

Walk the graph and perform a specific mutation.

Parameters
[in,out]gGraph to walk and mutate

Implements IGraphMutator.

Definition at line 284 of file SyntheticDataTypeMutator.cpp.

References ARM_COMPUTE_LOG_GRAPH_VERBOSE.

285 {
286  if(is_mutation_supported(g))
287  {
288  // Remove nodes that get optimized out (e.g. BatchNorm)
289  remove_optimized_nodes(g);
290 
291  // Convert tensor
292  convert_tensors(g, _mutate_type);
293  convert_special_tensors(g);
294 
295  // Handle special nodes
296  handle_nodes_with_bias(g);
297  }
298  else
299  {
300  ARM_COMPUTE_LOG_GRAPH_VERBOSE("Synthetic data type mutator couldn't be applied" << std::endl);
301  }
302 }
#define ARM_COMPUTE_LOG_GRAPH_VERBOSE(x)
Definition: Logger.h:50

◆ name()

const char * name ( )
overridevirtual

Returns mutator name.

Returns
Mutator name

Implements IGraphMutator.

Definition at line 274 of file SyntheticDataTypeMutator.cpp.

275 {
276  return "SyntheticDataTypeMutator";
277 }

◆ type()

IGraphMutator::MutationType type ( ) const
overridevirtual

Returns mutation type.

Returns
Mutation type enumeration

Implements IGraphMutator.

Definition at line 279 of file SyntheticDataTypeMutator.cpp.

References IGraphMutator::IR.


The documentation for this class was generated from the following files: