code: def train_example(args):
      auto_est = AutoEstimator.from_torch(
          model_creator=model_creator,
          optimizer="Adam",
          loss="BCELoss",
          logs_dir="/tmp/zoo_automl_logs",
          resources_per_trial={"cpu": args.cpus_per_trial},
          name="test_fit",
      )
      train_data, val_data = get_train_val_data()
      auto_est.fit(
          data=train_data,
          epochs=args.epochs,
          validation_data=val_data,
          metric="accuracy",
          n_sampling=args.trials,
          search_space=create_linear_search_space(),
      )
      # Choose the best model
      best_model = auto_est.get_best_model()
  
      y_hat = (
          best_model(torch.from_numpy(val_data[0]).float())
          .detach()
          .numpy()
      )
      from zoo.orca.automl.metrics import Evaluator
  
      accuracy = Evaluator.evaluate(
          metric="accuracy", y_true=val_data[1], y_pred=y_hat
      )
      print("Evaluate: accuracy is", accuracy)
  
file_path: analytics-zoo/pyzoo/zoo/examples/orca/automl/autoestimator/autoestimator_pytorch.py
imports: import numpy
  import argparse
  import torch
  import torch.nn
  from zoo.orca.automl.auto_estimator import AutoEstimator
  from zoo.orca.automl.pytorch_utils import LR_NAME
  from zoo.orca import init_orca_context, stop_orca_context
label_desc: Use image node_id 5 for calling a global function with example usage: train_example(args) without return types