class_docstr: Base semiring class.
  
  Based on description in:
  
  * Semiring parsing :cite:`goodman1999semiring`
code: def fill(c, mask, v):
      mask = mask.to(c.device)
      return torch.where(
          mask, v.type_as(c).view((-1,) + (1,) * (len(c.shape) - 1)), c
      )
  
imports: import torch
label_desc: Use image node_id 4 for calling the Semiring obj's underlying member method code with example usage: obj.fill(c, mask, v) and returns: torch