Method: TensorStream::ArrayOpsHelper#_reduced_shape
- Defined in:
- lib/tensor_stream/evaluator/operation_helpers/array_ops_helper.rb
#_reduced_shape(input_shape, axes) ⇒ Object
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/tensor_stream/evaluator/operation_helpers/array_ops_helper.rb', line 41 def _reduced_shape(input_shape, axes) return [] if axes.nil? # reduce to scalar axes = [axes] unless axes.is_a?(Array) return input_shape if axes.empty? axes.each do |dimen| input_shape[dimen] = 1 end input_shape end |