All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ComputationRequestHasher Struct Reference

#include <nnet-optimize.h>

Public Member Functions

size_t operator() (const ComputationRequest *cr) const noexcept
 

Detailed Description

Definition at line 186 of file nnet-optimize.h.

Member Function Documentation

size_t operator() ( const ComputationRequest cr) const
noexcept

Definition at line 609 of file nnet-optimize.cc.

610  {
611  size_t ans = 0;
612  size_t p1 = 4111, p2 = 26951;
613  IoSpecificationHasher io_hasher;
614  std::vector<IoSpecification>::const_iterator itr = cr->inputs.begin(),
615  end = cr->inputs.end();
616  for (; itr != end; ++itr)
617  ans = ans * p1 + io_hasher(*itr);
618  itr = cr->outputs.begin();
619  end = cr->outputs.end();
620  for (; itr != end; ++itr)
621  ans = ans * p2 + io_hasher(*itr);
622  return ans;
623 }

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