Skip to content

Inputs & Outputs

Understanding input/output handling, data types, shapes, and validation.


🎯 Overview

Learn how to work with model inputs and outputs effectively.


📥 Input Handling

Data Types

Supported types: - float32, float64 - int32, int64 - bool, string

Shapes

inputs:
  data:
    type: float32
    shape: [1, 10]  # Fixed: batch=1, features=10
    # or
    shape: [-1, 10]  # Dynamic batch

JSON Format

{
  "input_name": [[1.0, 2.0, 3.0]]
}

📤 Output Handling

Output Format

{
  "output_name": [[0.2, 0.8]]
}

With Labels

outputs:
  sentiment:
    labels: [negative, positive]

Returns:

{
  "sentiment": [[0.2, 0.8]],
  "labels": ["negative", "positive"]
}


✅ Validation

GPUX automatically validates: - Input names match - Data types match - Shapes compatible


💡 Key Takeaways

Success

✅ Input data types and shapes ✅ JSON format ✅ Output handling ✅ Automatic validation


Previous: Providers | Next: Preprocessing →