Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs-guides/source/mlmodel-debugging-perf-utilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ from coremltools.models.ml_program.experimental.debugging_utils import MLModelVa
# Initialize MLModelValidator
validator = MLModelValidator(
model = model,
compute_unit = ct.ComputeUnit.CPU_ONLY,
compute_units = ct.ComputeUnit.CPU_ONLY,
)
# Find the ops that are responsible for NaN output
failing_ops = await validator.find_failing_ops_with_nan_output(
Expand All @@ -79,7 +79,7 @@ from coremltools.models.ml_program.experimental.debugging_utils import MLModelVa
# Initialize MLModelValidator
validator = MLModelValidator(
model = model,
compute_unit = ct.ComputeUnit.CPU_ONLY,
compute_units = ct.ComputeUnit.CPU_ONLY,
)
# Find the ops that are responsible for NaN output
failing_ops = await validator.find_failing_ops_with_infinite_output(
Expand All @@ -101,7 +101,7 @@ from coremltools import proto
# Initialize MLModelValidator
validator = MLModelValidator(
model = model,
compute_unit = ct.ComputeUnit.CPU_ONLY,
compute_units = ct.ComputeUnit.CPU_ONLY,
)

def validate_output(op: proto.MIL_pb2.Operation, value: np.array):
Expand Down Expand Up @@ -199,7 +199,7 @@ comparator = TorchScriptMLModelComparator(
coremltools.TensorType(name="x", shape=inputs[0].shape, dtype=np.float32),
coremltools.TensorType(name="y", shape=inputs[1].shape, dtype=np.float32),
],
compute_unit = ct.ComputeUnit.CPU_ONLY,
compute_units = ct.ComputeUnit.CPU_ONLY,
)

# Define a custom comparison function
Expand Down Expand Up @@ -255,7 +255,7 @@ comparator = TorchExportMLModelComparator(
ct.TensorType(name="x", shape=inputs[0].shape, dtype=np.float32),
ct.TensorType(name="y", shape=inputs[1].shape, dtype=np.float32),
],
compute_unit = ct.ComputeUnit.CPU_ONLY,
compute_units = ct.ComputeUnit.CPU_ONLY,
)

# Define a custom comparison function
Expand Down