model_metadata.json embedded in the package.
PackageArchInfo
cuda_compute_capability
cuda_gpu_description
cpu_description
get_package_arch_info
Path to the .pt2 model package.
BioptimusRuntimeError- If the package archive cannot be read.
check_device_compatibility
Path to the .pt2 model package.
The CUDA device to validate against. Accepts a
torch.device, an integer device index, or None. When None (or a bare "cuda" device with no index), the current CUDA device is used. This ensures the check inspects the GPU the worker was actually assigned rather than always device 0.TensorSpec
name- Name of the tensor (e.g."x","histology_tiles").shape- List of dimension sizes. Dynamic dimensions are represented as the string_DYNAMIC; fixed dimensions are integers.dtype- Expected dtype as a string (e.g."float32","int64").description- Human-readable description from the model metadata.
fixed_shape
ndim
shape_description
PackageMetadata
model- Model class name (e.g."EfficientUnet").inputs- Ordered list of input tensor specifications.outputs- Ordered list of output tensor specifications.raw- The full raw metadata dictionary.
load_package_metadata
model_metadata.json file from the archive without extracting the full package.
Path to the .pt2 model package.
BioptimusRuntimeError- If the package archive or metadata JSON cannot be read.
validate_input_shapes
- All expected inputs are present.
- Each tensor has the correct number of dimensions.
- Fixed dimensions match exactly.
- Dynamic dimensions are consistent across inputs (same batch size).
The package metadata with input specifications.
Mapping of input name to tensor.

