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 170 of file nnet-optimize.h.

Member Function Documentation

size_t operator() ( const ComputationRequest cr) const
noexcept

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

546  {
547  size_t ans = 0;
548  size_t p1 = 4111, p2 = 26951;
549  IoSpecificationHasher io_hasher;
550  std::vector<IoSpecification>::const_iterator itr = cr->inputs.begin(),
551  end = cr->inputs.end();
552  for (; itr != end; ++itr)
553  ans = ans * p1 + io_hasher(*itr);
554  itr = cr->outputs.begin();
555  end = cr->outputs.end();
556  for (; itr != end; ++itr)
557  ans = ans * p2 + io_hasher(*itr);
558  return ans;
559 }

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