Skip to content

Commit

Permalink
Merge pull request tensorflow#62998 from 2JS:master
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 692966366
  • Loading branch information
tensorflower-gardener committed Nov 4, 2024
2 parents 149bf5f + 037566e commit 8cf3f16
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tensorflow/lite/swift/Sources/Interpreter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ public final class Interpreter {
/// The underlying `TfLiteInterpreter` C pointer.
internal var cInterpreter: CInterpreter?

/// Keep reference to underlying model's data in case of init(modelData:) is used.
internal let _model: Model

/// The underlying `TfLiteDelegate` C pointer for XNNPACK delegate.
private var cXNNPackDelegate: Delegate.CDelegate?

Expand Down Expand Up @@ -121,6 +124,7 @@ public final class Interpreter {

self.options = options
self.delegates = delegates
self._model = model
options.map {
if let threadCount = $0.threadCount, threadCount > 0 {
TfLiteInterpreterOptionsSetNumThreads(cInterpreterOptions, Int32(threadCount))
Expand Down

0 comments on commit 8cf3f16

Please sign in to comment.