MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / npRound

Function npRound

plugin/voxelGeneratorPlugin/voxelGenerator.cpp:45–54  ·  view source on GitHub ↗

Mimic np.round as in voxel generator in spconv implementation

Source from the content-addressed store, hash-verified

43
44// Mimic np.round as in voxel generator in spconv implementation
45int32_t npRound(float x)
46{
47 // half way round to nearest-even
48 int32_t x2 = lround(x * 2.0F);
49 if (x != static_cast<int32_t>(x) && x2 == x * 2.0F)
50 {
51 return lround(x / 2.0F + 0.5F) * 2;
52 }
53 return lround(x + 0.5F);
54}
55
56VoxelGeneratorPlugin::VoxelGeneratorPlugin(int32_t maxVoxels, int32_t maxPoints, int32_t voxelFeatures, float xMin,
57 float xMax, float yMin, float yMax, float zMin, float zMax, float pillarX, float pillarY, float pillarZ)

Callers 1

configurePluginMethod · 0.85

Calls 1

lroundFunction · 0.50

Tested by

no test coverage detected