Skip to content

Commit

Permalink
feat: add delegate option to client
Browse files Browse the repository at this point in the history
  • Loading branch information
stakach committed May 8, 2023
1 parent 4c04ff9 commit 1540914
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: tensorflow_lite
version: 1.1.0
version: 1.2.0

development_dependencies:
ameba:
Expand Down
5 changes: 4 additions & 1 deletion src/tensorflow_lite/client.cr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require "../tensorflow_lite"
class TensorflowLite::Client
include Indexable(Tensor)

def initialize(model : Bytes | Path | Model | String, threads : Int? = nil, &on_error : String -> Nil)
def initialize(model : Bytes | Path | Model | String, delegate : Delegate? = nil, threads : Int? = nil, &on_error : String -> Nil)
@model = case model
in String
Model.new(Path.new(model))
Expand All @@ -18,6 +18,9 @@ class TensorflowLite::Client
if threads
@options.num_threads(threads)
end
if delegate
@options.add_delegate delegate
end
@interpreter = Interpreter.new(@model, @options)
end

Expand Down

0 comments on commit 1540914

Please sign in to comment.