text stringlengths 0 93.6k |
|---|
self.encoder = Encoder(hp.embedding_size) |
self.decoder1 = MelDecoder() |
self.decoder2 = PostProcessingNet() |
def forward(self, characters, mel_input): |
memory = self.encoder.forward(characters) |
mel_output = self.decoder1.forward(mel_input, memory) |
linear_output = self.decoder2.forward(mel_output) |
return mel_output, linear_output |
# <FILESEP> |
#!/usr/bin/env python3 |
# -*- coding: utf-8 -*- |
import sys |
import json |
def listnodes(plan, path=(0,), depth=0): |
nodename = '%s_%s' % ( |
plan['Node Type'].replace(' ', '_'), '_'.join(map(str, path))) |
nodelabel = plan['Node Type'] |
self = (nodename, nodelabel) |
nodes = [self] |
links = [] |
for k, subplan in enumerate(plan.get('Plans', ())): |
s, n, l = listnodes(subplan, path + (k,)) |
nodes.extend(n) |
links.extend(l) |
links.append((self[0], s[0])) |
return self, nodes, links |
def exptree2dot(d): |
results = [ |
'digraph {', |
'rankdir=LR;' |
'edge [dir="back"];' |
] |
root, nodes, links = listnodes(d[0]['Plan']) |
for name, label in nodes: |
results.append('%s [label="%s"]' % (name, label)) |
for left, right in links: |
results.append('%s -> %s' % (left, right)) |
results.append('}') |
return '\n'.join(results) |
if __name__ == '__main__': |
print(exptree2dot(json.loads(sys.stdin.read()))) |
# <FILESEP> |
# pre code |
def testDivisibility(): |
print(" ") |
toTest = int(raw_input("Enter number of which you want to test Divisibility : ")) |
print(" ") |
test = int(raw_input("Enter number by which you want to test : ")) |
if toTest % test == 0 : |
print("-------------Answer---------------- ") |
print(str(toTest) + " is divisible by " + str(test)) |
else : |
print(str(toTest) + " is not divisible " + str(test)) |
print(" ") |
print("--------------------Start-------------------") |
user = raw_input("Start or End : ") |
if user.strip() == "Start" : |
print(testDivisibility()) |
print(" ") |
# MAIN code |
while True: |
get = raw_input("Start again or End : ") |
if get.strip() == "Start again": |
print("---------------Start Again----------------") |
print(" ") |
continue |
elif get.strip() == "End" : |
print(" ") |
print("------------------Program Ended--------------") |
print(" ") |
break |
else : |
break |
elif user.strip() == "End" : |
print(" ") |
print("------------Program Ended-----------") |
print(" ") |
break |
else : |
print(" ") |
print("Invalid Input. Try again") |
continue |
# <FILESEP> |
# Toyota Motor Europe NV/SA and its affiliates retain all intellectual property and |
# proprietary rights in and to this software, related documentation and any |
# modifications thereto. Any use, reproduction, disclosure or distribution of |
# this software and related documentation without an express license agreement |
# from Toyota Motor Europe NV/SA is strictly prohibited. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.