lib/tensorflow/ops.rb in tensorflow-0.1.1 vs lib/tensorflow/ops.rb in tensorflow-0.1.2

- old
+ new

@@ -1,36 +1,37 @@ # keep in alphabetical order module TensorFlow module Ops - def eye(num_rows, num_columns: nil) - num_columns ||= num_rows - zeros = self.zeros([num_rows, num_columns]) - ones = self.ones([num_rows]) - RawOps.matrix_set_diag(input: zeros, diagonal: ones) + def cast(x, dtype) + Utils.execute("Cast", [x], DstT: FFI::DataType[dtype]) end + def expand_dims(input, axis) + RawOps.expand_dims(input: input, dim: axis) + end + def fill(dims, value) RawOps.fill(dims: dims, value: value) end def identity(input) RawOps.identity(input: input) end - def matmul(a, b) - RawOps.mat_mul(a: a, b: b) - end - def ones(dims) fill(dims, 1) end def range(start, limit = nil, delta = 1) unless limit limit = start start = 0 end RawOps.range(start: start, limit: limit, delta: delta) + end + + def squeeze(input, axis: nil) + RawOps.squeeze(input: input, squeeze_dims: axis) end def timestamp RawOps.timestamp end