MCPcopy Create free account
hub / github.com/NVlabs/InstantSplat / blur_stepfun

Function blur_stepfun

utils/stepfun.py:395–403  ·  view source on GitHub ↗
(x, y, r)

Source from the content-addressed store, hash-verified

393
394
395def blur_stepfun(x, y, r):
396 xr, xr_idx = torch.sort(torch.cat([x - r, x + r], dim=-1))
397 y1 = (torch.cat([y, torch.zeros_like(y[..., :1])], dim=-1) -
398 torch.cat([torch.zeros_like(y[..., :1]), y], dim=-1)) / (2 * r)
399 y2 = torch.cat([y1, -y1], dim=-1).take_along_dim(xr_idx[..., :-1], dim=-1)
400 yr = torch.cumsum((xr[..., 1:] - xr[..., :-1]) *
401 torch.cumsum(y2, dim=-1), dim=-1).clamp_min(0)
402 yr = torch.cat([torch.zeros_like(yr[..., :1]), yr], dim=-1)
403 return xr, yr

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected