MCPcopy Create free account
hub / github.com/davisking/dlib / dot

Function dot

dlib/cuda/cpu_dlib.cpp:1602–1617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1600 }
1601
1602 void dot (
1603 const tensor& a,
1604 const tensor& b,
1605 tensor& result,
1606 size_t idx
1607 )
1608 {
1609 DLIB_CASSERT(a.size() == b.size());
1610 DLIB_CASSERT(idx < result.size());
1611
1612 const auto aa = a.host();
1613 const auto bb = b.host();
1614 auto r = result.host();
1615 for (size_t i = 0; i < a.size(); ++i)
1616 r[idx] += aa[i]*bb[i];
1617 }
1618
1619 // -----------------------------------------------------------------------------------
1620 // -----------------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
hostMethod · 0.45

Tested by

no test coverage detected