Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def create_ports():
input_ports = {
"log_probs": NeuralType({1: AxisType(TimeTag),
0: AxisType(BatchTag),
2: AxisType(ChannelTag)}),
"targets": NeuralType({0: AxisType(BatchTag),
1: AxisType(TimeTag)}),
"input_length": NeuralType({0: AxisType(BatchTag)}),
"target_length": NeuralType({0: AxisType(BatchTag)})
}
output_ports = {"loss": NeuralType(None)}
return input_ports, output_ports
def create_ports():
input_ports = {
'log_probs': NeuralType({
0: AxisType(BatchTag),
1: AxisType(TimeTag),
2: AxisType(ChannelTag)
}),
'targets': NeuralType({
0: AxisType(BatchTag),
1: AxisType(TimeTag)
})
}
output_ports = {
'loss': NeuralType(None)
}
return input_ports, output_ports
def create_ports():
input_ports = {
'log_probs': NeuralType({
0: AxisType(BatchTag),
1: AxisType(TimeTag),
2: AxisType(ChannelTag)
}),
'targets': NeuralType({
0: AxisType(BatchTag),
1: AxisType(TimeTag)
})
}
output_ports = {
'loss': NeuralType(None)
}
return input_ports, output_ports
def create_ports():
input_ports = {
"encoder_output": NeuralType(
{0: AxisType(BatchTag),
1: AxisType(EncodedRepresentationTag),
2: AxisType(ProcessedTimeTag)})}
output_ports = {
"output": NeuralType({
0: AxisType(BatchTag),
1: AxisType(TimeTag),
2: AxisType(ChannelTag)
})}
return input_ports, output_ports
def create_ports():
input_ports = {
'tensor': NeuralType({
0: AxisType(BatchTag),
1: AxisType(ChannelTag),
2: AxisType(TimeTag)
})
}
output_ports = {
'tensor': NeuralType({
0: AxisType(BatchTag),
1: AxisType(TimeTag),
2: AxisType(ChannelTag)
})
}
return input_ports, output_ports
def create_ports():
input_ports = {}
output_ports = {
"audio_signal": NeuralType({0: AxisType(BatchTag),
1: AxisType(TimeTag)}),
"a_sig_length": NeuralType({0: AxisType(BatchTag)}),
"transcripts": NeuralType({0: AxisType(BatchTag),
1: AxisType(TimeTag)}),
"transcript_length": NeuralType({0: AxisType(BatchTag)})
}
return input_ports, output_ports
1: AxisType(TimeTag)
token_type_ids:
0: AxisType(BatchTag)
1: AxisType(TimeTag)
attention_mask:
0: AxisType(BatchTag)
1: AxisType(TimeTag)
"""
return {
"input_ids": NeuralType({
0: AxisType(BatchTag),
1: AxisType(TimeTag)
}),
"token_type_ids": NeuralType({
0: AxisType(BatchTag),
1: AxisType(TimeTag)
}),
"attention_mask": NeuralType({
0: AxisType(BatchTag),
1: AxisType(TimeTag)
})
def create_ports():
input_ports = {
"logits": NeuralType({
0: AxisType(BatchTag),
1: AxisType(TimeTag),
2: AxisType(ChannelTag),
3: AxisType(ChannelTag)
}),
"targets": NeuralType({
0: AxisType(BatchTag),
1: AxisType(ChannelTag),
2: AxisType(TimeTag)
}),
"mask": NeuralType({
0: AxisType(BatchTag),
1: AxisType(ChannelTag)
}),
}
output_ports = {"loss": NeuralType(None)}
return input_ports, output_ports
def create_ports():
input_ports = {
'encoder_hidden': NeuralType({
0: AxisType(BatchTag),
1: AxisType(TimeTag),
2: AxisType(ChannelTag)
}),
'encoder_outputs': NeuralType({
0: AxisType(BatchTag),
1: AxisType(TimeTag),
2: AxisType(ChannelTag)
}),
'input_lens': NeuralType({
0: AxisType(BatchTag),
}),
'src_ids': NeuralType({
0: AxisType(BatchTag),
1: AxisType(TimeTag)
}),
# 'tgt_lens': NeuralType({
# 0: AxisType(BatchTag),
# 1: AxisType(ChannelTag)
# }),
'targets': NeuralType({
0: AxisType(BatchTag),
1: AxisType(ChannelTag), # the number of slots
def create_ports():
input_ports = {
'tensor': NeuralType({
0: AxisType(BatchTag),
1: AxisType(ChannelTag),
2: AxisType(TimeTag)
})
}
output_ports = {
'tensor': NeuralType({
0: AxisType(BatchTag),
1: AxisType(TimeTag),
2: AxisType(ChannelTag)
})
}
return input_ports, output_ports