module TensorFlow::Ops
Public Instance Methods
cast(x, dtype)
click to toggle source
# File lib/tensorflow/ops.rb, line 4 def cast(x, dtype) Utils.execute("Cast", [x], DstT: FFI::DataType[dtype]) end
expand_dims(input, axis)
click to toggle source
# File lib/tensorflow/ops.rb, line 8 def expand_dims(input, axis) RawOps.expand_dims(input: input, dim: axis) end
fill(dims, value)
click to toggle source
# File lib/tensorflow/ops.rb, line 12 def fill(dims, value) RawOps.fill(dims: dims, value: value) end
identity(input)
click to toggle source
# File lib/tensorflow/ops.rb, line 16 def identity(input) RawOps.identity(input: input) end
ones(dims)
click to toggle source
# File lib/tensorflow/ops.rb, line 20 def ones(dims) fill(dims, 1) end
range(start, limit = nil, delta = 1)
click to toggle source
# File lib/tensorflow/ops.rb, line 24 def range(start, limit = nil, delta = 1) unless limit limit = start start = 0 end RawOps.range(start: start, limit: limit, delta: delta) end
reshape(tensor, shape)
click to toggle source
# File lib/tensorflow/ops.rb, line 32 def reshape(tensor, shape) RawOps.reshape(tensor: tensor, shape: shape) end
squeeze(input, axis: nil)
click to toggle source
# File lib/tensorflow/ops.rb, line 36 def squeeze(input, axis: nil) RawOps.squeeze(input: input, squeeze_dims: axis) end
timestamp()
click to toggle source
# File lib/tensorflow/ops.rb, line 40 def timestamp RawOps.timestamp end
transpose(x, perm: [1, 0])
click to toggle source
# File lib/tensorflow/ops.rb, line 44 def transpose(x, perm: [1, 0]) RawOps.transpose(x: x, perm: perm) end
zeros(dims)
click to toggle source
# File lib/tensorflow/ops.rb, line 48 def zeros(dims) fill(dims, 0) end
zeros_like(x)
click to toggle source
# File lib/tensorflow/ops.rb, line 52 def zeros_like(x) RawOps.zeros_like(x: x) end