parameters: (ctx)
return_statement: return evaluate_emb(outputs, labels)
docstring: Test a model.
docstring_summary: Test a model.
docstring_tokens: Test a model .
function: def test(ctx):
      """Test a model."""
      val_data.reset()
      outputs = []
      labels = []
      for batch in val_data:
          data = gluon.utils.split_and_load(batch.data[0], ctx_list=ctx, batch_axis=0)
          label = gluon.utils.split_and_load(batch.label[0], ctx_list=ctx, batch_axis=0)
          for x in data:
              outputs.append(net(x)[-1])
          labels += label
  
      outputs = nd.concatenate(outputs, axis=0)[:val_data.n_test]
      labels = nd.concatenate(labels, axis=0)[:val_data.n_test]
      return evaluate_emb(outputs, labels)
function_tokens: def test ( ctx ) : val_data . reset ( ) outputs = [ ] labels = [ ] for batch in val_data : data = gluon . utils . split_and_load ( batch . data [ 0 ] , ctx_list = ctx , batch_axis = 0 ) label = gluon . utils . split_and_load ( batch . label [ 0 ] , ctx_list = ctx , batch_axis = 0 ) for x in data : outputs . append ( net ( x ) [ - 1 ] ) labels += label outputs = nd . concatenate ( outputs , axis = 0 ) [ : val_data . n_test ] labels = nd . concatenate ( labels , axis = 0 ) [ : val_data . n_test ] return evaluate_emb ( outputs , labels )