def test_necessario(self):
        self.assertTrue(self.seg_p)

        seg_p2 = itau.registros.SegmentoP()
        self.assertFalse(seg_p2.necessario())

        seg_p2.controle_banco = 33
        self.assertFalse(seg_p2.necessario())

        seg_p2.vencimento_titulo = 10102012
        self.assertTrue(seg_p2.necessario())
def gradients(self, d_grads, g_grads):
      if self.d_grads is None:
          self.d_grads = [torch.zeros_like(_g) for _g in d_grads]
          self.g_grads = [torch.zeros_like(_g) for _g in g_grads]