ComputationRequestHasher Struct Reference

#include <nnet-computation.h>

Public Member Functions

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

Detailed Description

Definition at line 163 of file nnet-computation.h.

Member Function Documentation

◆ operator()()

size_t operator() ( const ComputationRequest cr) const
noexcept

Definition at line 1204 of file nnet-computation.cc.

1205  {
1206  size_t ans = 0;
1207  size_t p1 = 4111, p2 = 26951;
1208  IoSpecificationHasher io_hasher;
1209  std::vector<IoSpecification>::const_iterator itr = cr->inputs.begin(),
1210  end = cr->inputs.end();
1211  for (; itr != end; ++itr)
1212  ans = ans * p1 + io_hasher(*itr);
1213  itr = cr->outputs.begin();
1214  end = cr->outputs.end();
1215  for (; itr != end; ++itr)
1216  ans = ans * p2 + io_hasher(*itr);
1217  return ans;
1218 }

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