torchaudio 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f35bd53e4a972f24d5d0a0bfbe8ee45a76a203a535a96043608fa768fee71bf4
4
- data.tar.gz: 2a6061fa3aa68c13352ec7c12a79faf85a332163f92b976614fb2f59a1c53d68
3
+ metadata.gz: 5c21f515fb744d7de39c8abbb3ce6ae0bd9681fecb56c2e1b52163aebf47617f
4
+ data.tar.gz: 969191c9df1f01a9a3ee14b21ce6ddc74f476530da3da642eac3d880fc09b166
5
5
  SHA512:
6
- metadata.gz: 3f3566e6d1cc9bf1467c39350a4c317c2e192d75851c96d725f4e128be42b9fe9ab9be9c3b6ff33a4ab23f38d7d63b820f001f5b9e4af888f8e8b9b98fe795a5
7
- data.tar.gz: bde46760427829d4c9955eba0da00f900425e44cb1fe93c6788691c964949d30d9a47ee3e896df226327294018ea4d4149acc25102e85598394644d5f0e3b568
6
+ metadata.gz: c6a27dcc0d9a07b5323a2906534752b06b34dfbe8444a46a1b2aeb2d4182ca8ffc3192cba23f1ab954359366368d5c9959035c30a7e4838b76d1bb8fce8e8e6c
7
+ data.tar.gz: 647c88bbd2d3b4556a678ac1c8a00eadb3a332d45108902cd7f09d17d721416f1ac04abd2d57f8dfa71482b1258ec1453e5fcdacb13d58fcf1a37bd5c3461cce
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.3.2 (2023-02-27)
2
+
3
+ - Improved LibTorch and SoX detection for Homebrew on Mac ARM and Linux
4
+
5
+ ## 0.3.1 (2023-01-29)
6
+
7
+ - Added `format` option
8
+
1
9
  ## 0.3.0 (2022-07-06)
2
10
 
3
11
  - Added `center`, `pad_mode`, and `onesided` options to `Spectogram` transform
data/LICENSE.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  BSD 2-Clause License
2
2
 
3
3
  Copyright (c) 2017 Facebook Inc. (Soumith Chintala),
4
- Copyright (c) 2020-2022 Andrew Kane,
4
+ Copyright (c) 2020-2023 Andrew Kane,
5
5
  All rights reserved.
6
6
 
7
7
  Redistribution and use in source and binary forms, with or without
@@ -2,8 +2,6 @@ require "mkmf-rice"
2
2
 
3
3
  $CXXFLAGS += " -std=c++17 $(optflags)"
4
4
 
5
- abort "SoX not found" unless have_library("sox")
6
-
7
5
  ext = File.expand_path(".", __dir__)
8
6
  csrc = File.expand_path("csrc", __dir__)
9
7
 
@@ -31,9 +29,19 @@ else
31
29
  $CXXFLAGS += " -Wno-duplicated-cond -Wno-suggest-attribute=noreturn"
32
30
  end
33
31
 
32
+ paths = [
33
+ "/usr/local",
34
+ "/opt/homebrew",
35
+ "/home/linuxbrew/.linuxbrew"
36
+ ]
37
+
34
38
  inc, lib = dir_config("torch")
35
- inc ||= "/usr/local/include"
36
- lib ||= "/usr/local/lib"
39
+ inc ||= paths.map { |v| "#{v}/include" }.find { |v| Dir.exist?("#{v}/torch") }
40
+ lib ||= paths.map { |v| "#{v}/lib" }.find { |v| Dir["#{v}/*torch_cpu*"].any? }
41
+
42
+ unless inc && lib
43
+ abort "LibTorch not found"
44
+ end
37
45
 
38
46
  cuda_inc, cuda_lib = dir_config("cuda")
39
47
  cuda_inc ||= "/usr/local/cuda/include"
@@ -65,5 +73,7 @@ if with_cuda
65
73
  $LDFLAGS += " -Wl,--no-as-needed,#{lib}/libtorch.so"
66
74
  end
67
75
 
76
+ abort "SoX not found" unless have_library("sox")
77
+
68
78
  # create makefile
69
79
  create_makefile("torchaudio/ext")
@@ -1,3 +1,3 @@
1
1
  module TorchAudio
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.2"
3
3
  end
data/lib/torchaudio.rb CHANGED
@@ -31,9 +31,10 @@ module TorchAudio
31
31
  class Error < StandardError; end
32
32
 
33
33
  class << self
34
+ # TODO remove filetype in 0.4.0
34
35
  def load(
35
36
  filepath, out: nil, normalization: true, channels_first: true, num_frames: 0,
36
- offset: 0, signalinfo: nil, encodinginfo: nil, filetype: nil
37
+ offset: 0, signalinfo: nil, encodinginfo: nil, filetype: nil, format: nil
37
38
  )
38
39
 
39
40
  filepath = filepath.to_s
@@ -59,7 +60,7 @@ module TorchAudio
59
60
 
60
61
  # same logic as C++
61
62
  # could also make read_audio_file work with nil
62
- filetype ||= File.extname(filepath)[1..-1]
63
+ format ||= filetype || File.extname(filepath)[1..-1]
63
64
 
64
65
  sample_rate =
65
66
  Ext.read_audio_file(
@@ -70,7 +71,7 @@ module TorchAudio
70
71
  offset,
71
72
  signalinfo,
72
73
  encodinginfo,
73
- filetype
74
+ format
74
75
  )
75
76
 
76
77
  # normalize if needed
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: torchaudio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-06 00:00:00.000000000 Z
11
+ date: 2023-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: torch-rb
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  requirements: []
96
- rubygems_version: 3.3.7
96
+ rubygems_version: 3.4.6
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: Data manipulation and transformation for audio signal processing