code: def bce_common(self, assertion):
      shape = (self.b, self.h)
      target = torch.rand(shape)
      mod = nn.BCELoss()
      m = lambda x: mod(x, target)
      f = ft.partial(F.binary_cross_entropy, target=target)
      for fn in [m, f]:
          x = torch.rand(shape, dtype=torch.half)
          assertion(fn, x)
  
imports: import unittest
  import functools
  import itertools
  from apex import amp
  import torch
  from torch import nn
  import torch.nn.functional
  from utils import common_init, HALF, FLOAT, ALWAYS_HALF, ALWAYS_FLOAT, MATCH_INPUT
label_desc: Use image node_id 3 for calling the TestBannedMethods obj's underlying member method code with example usage: obj.bce_common(assertion) without return types