class_docstr: Represents a NumPy dataset for use with MLflow Tracking.
class_docstr_tok: ["Represents","a","NumPy","dataset","for","use","with","MLflow","Tracking","."]
docstr: MLflow TensorSpec schema representing the dataset features and targets (optional).
docstr_tok: ["MLflow","TensorSpec","schema","representing","the","dataset","features","and","targets","(","optional",")","."]
code: def schema(self) -> Optional[TensorDatasetSchema]:
      """
      MLflow TensorSpec schema representing the dataset features and targets (optional).
      """
      try:
          features_schema = _infer_schema(self._features)
          targets_schema = None
          if self._targets is not None:
              targets_schema = _infer_schema(self._targets)
          return TensorDatasetSchema(
              features=features_schema, targets=targets_schema
          )
      except Exception as e:
          _logger.warning(
              "Failed to infer schema for NumPy dataset. Exception: %s",
              e,
          )
          return None
  
imports: import json
  import logging
  from functools import cached_property
  from typing import Any, Dict, Optional, Union
  import numpy
  from mlflow.data.dataset import Dataset
  from mlflow.data.dataset_source import DatasetSource
  from mlflow.data.digest_utils import compute_numpy_digest
  from mlflow.data.pyfunc_dataset_mixin import PyFuncConvertibleDatasetMixin, PyFuncInputsOutputs
  from mlflow.data.schema import TensorDatasetSchema
  from mlflow.models.evaluation.base import EvaluationDataset
  from mlflow.types.utils import _infer_schema
  from mlflow.utils.annotations import experimental
label_desc: Use image node_id 8 for calling the NumpyDataset obj's underlying member method code with example usage: obj.schema() and returns: TensorDatasetSchema, None