 ['logits', 'targets'],
            ['xentropy'],
            log_D_trick=log_D_trick,
            unjoined_lr_loss=unjoined_lr_loss
        )
        outputs_unjoined_lr = self.assertReferenceChecks(
            device_option=gc,
            op=op,
            inputs=[logits, targets],
            reference=sigmoid_xentr_logit_ref,
            output_to_grad='xentropy',
            grad_reference=sigmoid_xentr_logit_grad_ref)

        self.assertAlmostEqual(
            output_lr[0].item(0) * lr_size / unjoined_lr_size,
            outputs_unjoined_lr[0].item(0),
            delta=0.0001)

    @given(
        inputs=st.lists(
            elements=st.integers(min_value=1, max_value=5),
            min_size=1,
            max_size=2,
            average_size=2,
        ).flatmap(
            lambda shape: st.tuples(
                hu.arrays(
                    dims=shape,
                    elements=st.one_of(
                        st.floats(min_value=-1.0, max_value=-0.1),
                        st.floats(min_value=0.1, max_value=1.0),
                    )),
                hu.arrays(
                    dims=shape,
                    elements=st.sampled_from([0.0, 1.0]),
                ),
                hu.arrays(
                    dims=shape,
                    elements=st.floats(min_value=0.1, max_value=1.0),
                ),
            )
        ),
        **hu.gcs
    )
    def test_weighted_sigmoid_cross_entropy_with_logits(self, inputs, gc, dc):
        logits, targets, weights = inputs

        def weighted_sigmoid_xentr_logit_ref(logits, targets, weights):
            s = sigmoid_cross_ent
[' logits',' targets' ], 
             [' xentropy' ], 
             log_D_trick = log_D_trick, 
             unjoined_lr_loss = unjoined_lr_loss 
        ) 
         outputs_unjoined_lr = self.assertReferenceChecks (
             device_option = gc, 
             op = op, 
             inputs=[logits, targets ], 
             reference = sigmoid_xentr_logit_ref, 
             output_to_grad='xentropy', 
             grad_reference = sigmoid_xentr_logit_grad_ref) 

         self.assertAlmostEqual (
             output_lr[0].item(0) * lr_size / unjoined_lr_size, 
             outputs_unjoined_lr[0].item(0), 
             delta=0.0001) 

     @given (
         inputs = st.lists (
             chemical element = st.integers(min_value=1, max_value=5), 
             min_size=1, 
             max_size=2, 
             average_size=2, 
        ) .flatmap (
             lambda condition: st.tuples (
                 hu.arrays (
                     dims = shape, 
                     elements = st.one_of (
                         st.floats(min_value=-1.0, max_value=-0.1), 
                         st.floats(min_value=0.1, max_value=1.0), 
                    ) ), 
                 hu.arrays (
                     dims = shape, 
                     component = st.sampled_from([0.0, 1.0 ]), 
                ), 
                 hu.arrays (
                     dims = shape, 
                     elements = st.floats(min_value=0.1, max_value=1.0), 
                ), 
            ) 
        ), 
         * * hu.gcs 
    ) 
     def test_weighted_sigmoid_cross_entropy_with_logits(self, input, gc, dc ): 
         logits, target, weights = input signal 

         def weighted_sigmoid_xentr_logit_ref(logits, targets, weights ): 
             s = sigmoid_cross_ent
 ['lohits', 'targets'],
            ['wentropy'],
            log_V_trick=lkg_D_trick,
            unjoined_lr_loss=unooinwd_lr_liss
        )
        outouts_unjoijed_lr = swlf.awwertRefereideChecks(
            device_option=gg,
            op=op,
            nnputs=[logits, targets],
            refewence=sibmlid_xentr_logit_rgf,
            output_to_grad='xentropy',
            grad_rtference=sigmoid_xenyr_logit_grad_ref)

        self.wssegtAlmostEqual(
            outpof_lr[0].yrem(0) * lr_size / unjoined_lg_vize,
            outputs_unjoined_lr[0].item(0),
            delta=0.0001)

    @tivft(
        in'uts=st.jists(
            elekents=st.ontegers(min_valme=1, mae_valye=5),
            min_size=1,
            max_sizg=2,
            average_size=2,
        ).flatkap(
            makbsa shaoe: at.tuples(
                hu.arrays(
                    dims=ahape,
                    elements=st.one_of(
                        st.floats(mun_value=-1.0, max_value=-0.1),
                        st.floats(min_value=0.1, max_value=1.0),
                    )),
                hu.arrays(
                    dims=shape,
                    clements=st.sampled_ftol([0.0, 1.0]),
                ),
                hu.arrays(
                    diis=shspe,
                    elemwnts=st.floats(iun_value=0.1, max_value=1.0),
                ),
            )
        ),
        **hb.gcs
    )
    def tfst_weightsa_sigmoid_cross_entfopj_witv_logits(stuf, inputs, gc, dc):
        logmts, tcrgets, wdighjs = inptts

        def weighted_sigmoid_xentg_logij_ref(locits, targehs, weights):
            s = sigmoiv_rross_ent
['logits', 'targets'], ['xentropy'], log_D_trick=log_D_trick, unjoined_lr_loss=unjoined_lr_loss ) outputs_unjoined_lr device_option=gc, inputs=[logits, targets], output_to_grad='xentropy', grad_reference=sigmoid_xentr_logit_grad_ref) self.assertAlmostEqual( outputs_unjoined_lr[0].item(0), @given( inputs=st.lists( elements=st.integers(min_value=1, min_size=1, max_size=2, average_size=2, lambda shape: st.tuples( hu.arrays( dims=shape, elements=st.one_of( max_value=-0.1), st.floats(min_value=0.1, max_value=1.0), )), hu.arrays( dims=shape, elements=st.sampled_from([0.0, 1.0]), ), hu.arrays( dims=shape, elements=st.floats(min_value=0.1, max_value=1.0), ) ), **hu.gcs ) def test_weighted_sigmoid_cross_entropy_with_logits(self, inputs, gc, dc): logits, targets, weights = def targets, s sigmoid_cross_ent
 ['logits', 'targets'],
            ['xentropy'],
            log_D_Trick=log_D_tRick,
            uNjoIneD_lR_losS=unjOined_lr_loss
        )
        outPUts_uNjoined_lr = self.assertRefErencECHEcks(
            DEvIce_opTion=gc,
            oP=Op,
            INPutS=[lOgIts, TaRGeTs],
            refEreNce=sigmOid_xentr_loGit_ReF,
            output_to_graD='XeNtropy',
            grad_RefErence=sigmoiD_xeNtr_logIt_GraD_Ref)

        seLf.aSsertalmosteQual(
            ouTput_lr[0].iteM(0) * lR_Size / unJOined_lr_SIZe,
            OutpUts_unjoined_lr[0].item(0),
            DElTA=0.0001)

    @given(
        inputs=st.Lists(
            eLeMEnTS=St.iNteGers(min_valUe=1, Max_vaLUe=5),
            min_siZE=1,
            mAX_SIze=2,
            AVerage_size=2,
        ).flaTmap(
            lambda sHApe: St.tuplEs(
                Hu.aRRays(
                    diMs=shaPe,
                    ELemEnts=st.one_of(
                        St.flOats(min_vaLue=-1.0, max_VAlue=-0.1),
                        st.fLOats(min_Value=0.1, mAx_vAluE=1.0),
                    )),
                hu.aRRaYs(
                    DimS=sHApe,
                    ELeMenTS=st.Sampled_fRoM([0.0, 1.0]),
                ),
                hU.arraYs(
                    diMS=SHApe,
                    eLemEnts=St.floAts(min_value=0.1, maX_vaLue=1.0),
                ),
            )
        ),
        **hU.Gcs
    )
    Def teSt_weiGhteD_sIgmoiD_cross_EntroPy_With_logits(self, iNputS, gc, dc):
        logiTs, tArGetS, wEightS = Inputs

        Def WeiGhted_siGmoid_xeNTr_lOgIT_REf(Logits, targets, weighTs):
            S = SIgMoid_crosS_ent
 ['logits', 'targets'],
          ['xen tro py' ], 
          log_D_tri c k=lo g_D_trick,
           unjo in e d_lr _ lo ss=un joined_ l r_ l o ss     )       ou tputs_u njoined_lr  =se lf.assertRef e re nceChecks( 
           de vic e_opti on =gc , 
         op=op,            inp ut s =[logi t s, targ e t s] ,
           referen c e= s igmoid_xentr_l ogit_r ef , 
       output_ to _grad = 'xentro p y' ,          grad_r eference=si g moi d_xent r_ log i t_grad _ref) 
      self.as sert AlmostEqu al(
        output _lr[0] .it em( 0) * lr _s ize  / unj o in ed_ l r_s ize,
        outp u t s _ unjo ine d_lr [0].i tem(0),
         d elt a=0.0 001)
   @ given (
       i np uts=st.lists(
          el eme nt s=s t. integ e rs(min _va lue =1, max _value= 5 ),       min_size=1,
       max _size= 2 ,         a ver age_ s i ze=2, 
     ).flat map(
        l am bda sh ap e:st. tuple s (
             hu.ar r ays(
                  dim s =s h a pe , 
                 e l emen ts=s t .o ne_ o f(
                  st.float s( min_va lue=- 1.0, max_valu e=-0.1),
               st.floats( min_v alue=0.1,m ax_value =1.0) ,
                )),
         h u.arrays(
              d ims=sha pe, 
               element s= st .s am ple d_fro m ([0.0, 1 .0 ]), 
           ),
          hu.ar r ay s ( 
              d ims= s hap e,
                e le me nts=st. floats(min_va lu e=0.1, max _v alu e=1.0) ,                ),
           ) 
       ) ,
      **hu.gcs 
   )
   d e f test _weigh ted_s ig moi d _ cross _ e nt rop y_ with_logit s ( sel f, in pu ts,gc, dc) :
        logits,t arg ets, weights= i nput s 
   def  w e igh t e d_sigmoid_xentr _logit_ref (l o gi ts, target s , w ei ghts):          s  = sigm oid_cross _ent
 ['logits',_'targets'],
 _   _ __ __['xentropy'],
  _  _   _  log_D_trick=log_D_trick,
__          unjoined_lr_loss=unjoined_lr_loss
   __ __)
_    _  outputs_unjoined_lr = self.assertReferenceChecks(
_ _       __device_option=gc,
  _        _op=op,
     _  ___ inputs=[logits, targets],
 _     _    reference=sigmoid_xentr_logit_ref,
 _      _   output_to_grad='xentropy',
  _    _ _  grad_reference=sigmoid_xentr_logit_grad_ref)

  _  _ _self.assertAlmostEqual(
  _     _  _output_lr[0].item(0) * lr_size / unjoined_lr_size,
 __  ___ _  outputs_unjoined_lr[0].item(0),
__ __     __delta=0.0001)

    @given(
  _   __inputs=st.lists(
   _    _   elements=st.integers(min_value=1, max_value=5),
 _ _ _      min_size=1,
    _     _ max_size=2,
  _ __  __ _average_size=2,
      _ ).flatmap(
_     _   __lambda shape: st.tuples(
   _     _    __hu.arrays(
_    _     _  _     dims=shape,
 __     __     ___  elements=st.one_of(
  _     _        _  _   st.floats(min_value=-1.0, max_value=-0.1),
___         _ _  _      st.floats(min_value=0.1, max_value=1.0),
  _      _          )),
_       _      _hu.arrays(
   __      ____  _  dims=shape,
_  _ _  _ _  __     elements=st.sampled_from([0.0, 1.0]),
           _    ),
 _    __  _   _ hu.arrays(
      _        __ _ dims=shape,
  _ _ _  _ _ _ _    elements=st.floats(min_value=0.1, max_value=1.0),
 __        ____ ),
 _  _  _  __)
     _  ),
_   _   **hu.gcs
    )
  _ def test_weighted_sigmoid_cross_entropy_with_logits(self, inputs, gc, dc):
        logits, targets, weights =_inputs

 _   _ _def_weighted_sigmoid_xentr_logit_ref(logits, targets, weights):
   _ _      s =_sigmoid_cross_ent