Questions tagged [custom-operator]

37 questions
10
votes
3 answers

Why is the CPU implementation of my custom op being selected?

In order to learn how to write custom TensorFlow ops, I followed the Adding a New Op tutorial and made an "add_b" op that adds a scalar b to every input value. add_b_op.cc: #define EIGEN_USE_THREADS #include…
Daniel Trebbien
  • 38,421
  • 18
  • 121
  • 193
5
votes
1 answer

Using Perl 6 custom operators

I am studying chemistry in the university and want to try writing textbook examples in Perl6 or Perl, like balancing the chemical formula or other processes! Then I encountered the problem is on perl6 custom operator. I feel I have been repeating my…
黃家億
  • 355
  • 1
  • 4
5
votes
1 answer

Why is Nil coalescing operator Right Associative?

Shouldn’t it be Left Associative? I think let a = b ?? c ?? d is grouped like let a = (b ?? c) ?? d not let a = b ?? (c ?? d) But it is declared as a Right Associative. Do I misunderstand or miss something?
4
votes
1 answer

Is it possible to define the ** operator in F#

let (**) ls1 ls2 = List.intersect ls1 ls2 does not work because (**) is considered a comment. Is there any escape possibility?
citykid
  • 9,916
  • 10
  • 55
  • 91
4
votes
0 answers

How to debug models running in Tensorflow Serving?

I wanted to try my seq2seq model in Tensorflow Serving for deployment. So, I have implemented a Custom operation to replace a py_func to successfully export the python based code. I have tested that C++ custom op in two ways. Using…
4
votes
1 answer

Standards for when to use custom operators

I'm currently reading Real-World Functional Programming, and it briefly mentions in-fix operators as being one of the main benefits of custom operators. Are there any sort of standards for when to use or not use custom operators in F#? I'm looking…
N_A
  • 19,799
  • 4
  • 52
  • 98
3
votes
1 answer

Overloading of addition for arrays in Rust

Trying to sum two arrays ([1.0, 2.0] + [3.0, 4.0]) fails in Rust as addition isn't defined for arrays. I tried to overload the operation: use std::ops::Add; type float = f64; impl Add for [float;N] { type Output = Self; fn…
3
votes
1 answer

How do I implement custom operator [] in swift

I have written a simple queue class in swift. It's implemented by an Array. Now I want this performs more like built-in array.So I need to implement the []operator but failed. Somebody help? public class SimpleQueue { private var…
AntiMoron
  • 1,286
  • 1
  • 11
  • 29
2
votes
0 answers

Tensorflow C++ API: How to pass input parameters to CUDA kernel

I'm quite new to CUDA/C++ programming and I'm stuck at passing the input parameters to the CUDA Kernel from the Tensorflow C++ API. First off I register the following Op: REGISTER_OP("Op") .Attr("T: {float, int64}") .Input("in: T") .Input("angles:…
L. Brasi
  • 41
  • 2
2
votes
1 answer

How can I define a postfix operator on a tuple?

I have the following code: postfix operator ^^^ public postfix func ^^^(lhs: Int) -> Int { return 0 } public postfix func ^^^(lhs: (T, T)) -> [T] { return [lhs.0, lhs.1] } func go() { 1^^^ // this works (0, 0)^^^ // error: Unary…
meisel
  • 2,151
  • 2
  • 21
  • 38
2
votes
4 answers

How to use custom operations with tensorflow server

What is the ideal way to have tensorflow model server recognize my custom operation? I have a custom operation written following this guide: https://www.tensorflow.org/guide/extend/op I'm able to use the opp by calling tf.load_op_library, but when I…
2
votes
1 answer

How does MXNET C++ code bind with its python API?

1.When defining custom operator in MXNet with C++, how does the custom operator defined in C++ generate its python API automatically? 2.How can I finde the corresponding codes? 3. What's the difference between defining custom operator with C++ and…
2
votes
1 answer

How to define custom operator in computational expression

I want to define some custom operators on my computational expression, but can't make it work type ZipSeq() = [")>] member this.Apply f s = f |> Seq.zip s |> Seq.map (fun (y, x) -> x(y)) member this.Return…
baio
  • 1,102
  • 2
  • 12
  • 20
2
votes
1 answer

Replacing a node in graph with custom op having variable dependency in tensorflow

I am trying to replace the computation done in the graph with a custom op that does the same. Lets say the graph has a constant A and weight variable W, I create the custom op to take these two inputs and do the entire computation (except the last…
Anil Shanbhag
  • 950
  • 1
  • 13
  • 31
1
vote
1 answer

How to create custom rxjs operator with destructured parameters

I'm trying to create a custom RxJS filter operator that takes as a parameter destructured array. But it seems that typescript is not happy with the type, I'm getting this error: TS2493: Tuple type '[]' of length '0' has no element at index…
Or Shalmayev
  • 295
  • 1
  • 12
1
2 3