Class: Torch::NN::Conv1d
Instance Method Summary collapse
- #forward(input) ⇒ Object
-
#initialize(in_channels, out_channels, kernel_size, stride: 1, padding: 0, dilation: 1, groups: 1, bias: true, padding_mode: "zeros") ⇒ Conv1d
constructor
A new instance of Conv1d.
Methods inherited from ConvNd
Methods inherited from Module
#_apply, #add_module, #apply, #buffers, #call, #children, #cpu, #cuda, #double, #eval, #float, #half, #inspect, #load_state_dict, #method_missing, #modules, #named_buffers, #named_children, #named_modules, #named_parameters, #parameters, #register_buffer, #register_parameter, #requires_grad!, #respond_to?, #share_memory, #state_dict, #to, #train, #type, #zero_grad
Methods included from Utils
#_ntuple, #_pair, #_quadrupal, #_single, #_triple
Constructor Details
#initialize(in_channels, out_channels, kernel_size, stride: 1, padding: 0, dilation: 1, groups: 1, bias: true, padding_mode: "zeros") ⇒ Conv1d
Returns a new instance of Conv1d.
4 5 6 7 8 9 10 11 12 |
# File 'lib/torch/nn/conv1d.rb', line 4 def initialize(in_channels, out_channels, kernel_size, stride: 1, padding: 0, dilation: 1, groups: 1, bias: true, padding_mode: "zeros") kernel_size = _single(kernel_size) stride = _single(stride) padding = _single(padding) dilation = _single(dilation) super(in_channels, out_channels, kernel_size, stride, padding, dilation, false, _single(0), groups, bias, padding_mode) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Torch::NN::Module
Instance Method Details
#forward(input) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/torch/nn/conv1d.rb', line 14 def forward(input) if @padding_mode == "circular" raise NotImplementedError end F.conv1d(input, @weight, @bias, @stride, @padding, @dilation, @groups) end |