code: def from_task(
      cls,
      task: Task,
      task_type,
      embedding_sizes: list,
      categorical_fields: list,
      cat_dims: list,
      num_features: int,
      output_dim: int,
      backbone: str,
      loss_fn: Optional[Callable],
      metrics: Optional[
          Union[torchmetrics.Metric, List[torchmetrics.Metric]]
      ],
      backbone_kwargs: Optional[Dict[str, Any]] = None,
  ) -> Adapter:
      backbone_kwargs = backbone_kwargs or {}
      parameters = {
          "embedding_dims": embedding_sizes,
          "categorical_cols": categorical_fields,
          "categorical_cardinality": cat_dims,
          "categorical_dim": len(categorical_fields),
          "continuous_dim": num_features - len(categorical_fields),
          "output_dim": output_dim,
          "embedded_cat_dim": sum(
              [embd_dim for _, embd_dim in embedding_sizes]
          ),
      }
      return cls(
          task_type,
          task.backbones.get(backbone)(
              task_type=task_type,
              parameters=parameters,
              loss_fn=loss_fn,
              metrics=metrics,
              **backbone_kwargs,
          ),
      )
  
file_path: lightning-flash/src/flash/core/integrations/pytorch_tabular/adapter.py
imports: from typing import Any, Callable, Dict, List, Optional, Union
  import torchmetrics
  from flash.core.adapter import Adapter
  from flash.core.data.io.input import DataKeys
  from flash.core.model import Task
label_desc: Use image node_id 2 for calling the PytorchTabularAdapter obj's underlying member method code with example usage: obj.from_task(cls, task, task_type, embedding_sizes, categorical_fields, cat_dims, num_features, output_dim, backbone, loss_fn, metrics, backbone_kwargs) and returns: cls