Questions tagged [function-signature]
80 questions
0
votes
0 answers
Issue with altering the CLI wrapper for tflite_transfer_converter
I am trying to change the training and inference signature functions of my model that is going to be exported as a .tflite model to be used on a smartphone for on-device training. As the model is now, the body of it is a MobileNetV2 and the head…

NickTheGreek
- 1
- 1
0
votes
1 answer
Typescript: Refer to function argument inside the function signature
How can I refer to a specific function argument right inside the function signature?
The image above is a fake just for demonstration! I provide name and arg and need to retrieve some type info for arg by stuffing name into another function. But I…

cl10k
- 912
- 1
- 7
- 15
0
votes
1 answer
Inconsistencies with C++11 function signatures
I have questions regarding functions, more specific on function signatures and how to pass them. I might be a trivial or even stupid question, but I couldn't find a satisfying answer yet.
Please consider this example which uses a std::unique_ptr to…

DocDriven
- 3,726
- 6
- 24
- 53
0
votes
1 answer
Uncaught ArgumentCountError on function's nullable type parameter
I am using php 8.0 but for some reason union types and nullable types do not seem to work according to the documentation. ?Type or Type|null should make an argument optional according to the docs…

Aquaguy
- 357
- 2
- 11
0
votes
1 answer
Kotlin High order function signature types: matching function objects and type erasure
It seems that I'm missing something very important here. Kotlin function types are implemented with specific classes called FunctionN and use generics to define receiver, parameters and return type. Is there a syntax that can preserve the function…

GnoSiS
- 55
- 8
0
votes
3 answers
How to get a clean function signature in python as seen in the codebase?
I have the following code to get the function signature using inspect to print it to the terminal in Python
import inspect
def foo(a, b):
# do something
return ans
func_rep = foo
name = func_rep.__name__ # 'foo'
args =…

lamo_738
- 440
- 1
- 5
- 15
0
votes
0 answers
Is the Expression in an HtmlHelper For method's signature solely for type checking the View?
expression
Expression>
An expression that identifies the object that contains the properties to display.
DropDownListFor(HtmlHelper,
Expression>,
IEnumerable,…

johnny
- 19,272
- 52
- 157
- 259
0
votes
1 answer
Is *args in Python3 guaranteed to preserve order?
In Python3 i can use * to accept any number of positional arguments.
A sample demonstrating this:
def a(*args):
for argument in args:
print(argument)
a(1,2,3,4)
Would thus print:
1
2
3
4
What I'm uncertain is, if the order of…

Allu2
- 111
- 2
0
votes
2 answers
Does the documentation mention the possibility of adding the `mut` keyword in front of functions' arguments?
I have a basic Reader encapsulating some generic elements:
pub struct Reader {
inner: R,
order: Endian,
first_ifd_offset: usize,
}
impl Reader {
pub fn new(reader: R) -> Result> {
let mut…

yageek
- 4,115
- 3
- 30
- 48
0
votes
2 answers
How can I convert a string which contains a variable name into a variable which can be referenced?
I am creating a function which scans files for a certain function and determines which variables (all are already initialized) are used as parameters for the function. Currently, I am able to derive a cell array with strings for each individual…

Ak K
- 1
- 1
0
votes
0 answers
TypeScript function parameter signature - allow arrow function, disallow class method
Say that I have this class that wraps some other library:
class A {
method(callback: () => void): void {
// ...
}
}
and this one using it:
class B {
a: A;
constructor() {
this.a = new A();
}
do(): void {
…

J F
- 631
- 7
- 15
0
votes
1 answer
omit template parameter (for function pointer argument)
I'm writing template factory that stores function pointer to create user objects.
I would like to support user Creation function with and without argument (for now, one or zero argument will do).
(and i can't use boost or c11 unfortunately…

Peretz Levinov
- 1
- 1
- 1
0
votes
0 answers
How to call a specific JavaScript function even if they have the same signatures?
I have a specific situation. I hope you can help me..
I have two different html pages. I am parsing them and regenerating them as a single html page with Java. Each page contains many JavaScript functions and some of them have exactly the same…

GuneyK
- 1
- 2
0
votes
1 answer
Arbitrary evaluation in the type signature in agda
So I have another "simple" Adga question. I wanted to have a proof that used arbitrary evaluations as premises and results. But I don't think I know the type system well enough to do that.
as a simple example take
f : {S : Set} -> (a : S)
-> ( R…

user833970
- 2,729
- 3
- 26
- 41
0
votes
0 answers
What does the operator | mean in ml
I am writing some code in SML and I tackled this function signature
(bool | int) -> (int * int)
I wondered what's the meaning of this signature

Itai Caspi
- 39
- 1
- 9