code: def count_wraps(share_list):
      """Computes the number of overflows or underflows in a set of shares
  
      We compute this by counting the number of overflows and underflows as we
      traverse the list of shares.
      """
      result = torch.zeros_like(share_list[0], dtype=torch.long)
      prev = share_list[0]
      for cur in share_list[1:]:
          next = cur + prev
          result -= (
              (prev < 0) & (cur < 0) & (next > 0)
          ).long()  # underflow
          result += (
              (prev > 0) & (cur > 0) & (next < 0)
          ).long()  # overflow
          prev = next
      return result
  
file_path: FATE/python/fate/arch/protocol/mpc/common/util.py
imports: import functools
  import numpy
  import torch
  from fate.arch.protocol.mpc.cuda import CUDALongTensor
label_desc: Use image node_id 1 for calling a global function with example usage: count_wraps(share_list) and returns: result