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

Function threshold

dlib/cuda/cpu_dlib.cpp:1592–1600  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1590 // -----------------------------------------------------------------------------------
1591
1592 void threshold (
1593 tensor& data,
1594 float thresh
1595 )
1596 {
1597 const auto d = data.host();
1598 for (size_t i = 0; i < data.size(); ++i)
1599 d[i] = d[i]>thresh ? 1:0;
1600 }
1601
1602 void dot (
1603 const tensor& a,

Callers 3

test_basic_tensor_opsFunction · 0.50
test_more_opsFunction · 0.50
forward_inplaceMethod · 0.50

Calls 2

hostMethod · 0.45
sizeMethod · 0.45

Tested by 2

test_basic_tensor_opsFunction · 0.40
test_more_opsFunction · 0.40