code: def broadcast_scalar(scalar, src=0, device="cpu"):
      if get_world_size() < 2:
          return scalar
      scalar_tensor = torch.tensor(scalar).long().to(device)
      scalar_tensor = broadcast_tensor(scalar_tensor, src)
      return scalar_tensor.item()
  
imports: import contextlib
  import logging
  import os
  import pickle
  import socket
  import subprocess
  import warnings
  from itertools import chain
  import torch
  from mmf.common.registry import registry
  from torch import distributed
label_desc: Use image node_id 9 for calling a global function with example usage: broadcast_scalar(scalar, src, device) and returns: scalar_tensor, scalar